Sapporo Design and Language Company A4JP.COM
ウェブサイト制作、写真撮影、3DCG、3D印刷 など
〒060-0806
北海道札幌市北区北6条西6丁目2-1 朝日プラザ翆楽園 506号室
Tel/Fax: (011)768-8116
↑ Top札幌デザイン制作会社 A4JP
& NPO Study.
All rights reserved.
Remove Version Number From CSS & JS in WordPress Theme
Test Project 1
You want to remove the version number from the CSS & JS in your WordPress theme.
Go to your theme folder and open the functions.php file.
You can add the code below code to the bottom of your functions.php file. It is best to add this to the child theme if possible so updates of the main theme don’t remove the code.
// Remove WP Version From Styles
add_filter( ‘style_loader_src’, ‘sdt_remove_ver_css_js’, 9999 );
// Remove WP Version From Scripts
add_filter( ‘script_loader_src’, ‘sdt_remove_ver_css_js’, 9999 );
// Function to remove version numbers
function sdt_remove_ver_css_js( $src ) {
if ( strpos( $src, ‘ver=’ ) )
$src = remove_query_arg( ‘ver’, $src );
return $src;
}
After adding the code upload the file to your server.
The rest will be covered in the lesson.