Last active
November 8, 2017 02:17
-
-
Save senooat/e755bf81b84679badbb9bd0d94b0eff7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/*----------------------------------- | |
wp_head(),wp_footer()にJS,CSSを読み込み | |
-----------------------------------*/ | |
function add_files() { | |
if ( is_admin() ) return; | |
//共通 | |
wp_deregister_script('jquery'); | |
wp_enqueue_script('jquery', SITEURL.'/js/jquery.min.js',array(), '', false); | |
// wp_enqueue_script('temp-ga', SITEURL.'/js/ga.js',array(), '', false); | |
wp_enqueue_style( 'temp-style', get_stylesheet_uri() ); | |
// wp_enqueue_style( 'temp-font-awesome', STYLESHEETURI. '/css/font-awesome.min.css',array(), '', false); | |
// wp_enqueue_style( 'temp-normalize', STYLESHEETURI. '/css/normalize.css',array(), '', false); | |
//JS | |
wp_enqueue_script('temp-script', SITEURL.'/js/modernizr-2.6.2.min.js',array(), '', false); | |
wp_enqueue_script('temp-respond', SITEURL.'/js/respond.min.js',array(), '', false); | |
//IE 9未満(IE8以下)のみでhtml5shiv.jsを読み込ませる | |
wp_script_add_data('temp-respond', 'conditional', 'lt IE 9'); | |
wp_enqueue_script('temp-easing', SITEURL.'/js/jquery.easing.1.3.js',array(), '', true); | |
wp_enqueue_script('temp-bootstrap', SITEURL.'/js/bootstrap.min.js',array(), '', true); | |
wp_enqueue_script('temp-waypoints', SITEURL.'/js/jquery.waypoints.min.js',array(), '', true); | |
wp_enqueue_script('temp-main', SITEURL.'/js/main.js',array(), '', true); | |
//CSS | |
wp_enqueue_style( 'temp-animate', SITEURL. '/css/animate.css',array(), '', all); | |
wp_enqueue_style( 'temp-icomoon', SITEURL. '/css/icomoon.css',array(), '', all); | |
wp_enqueue_style( 'temp-bootstrap', SITEURL. '/css/bootstrap.css',array(), '', all); | |
wp_enqueue_style( 'temp-common', SITEURL. '/css/style.css',array(), '', all); | |
} | |
add_action('wp_enqueue_scripts', 'add_files'); | |
// remove wp version param from any enqueued scripts | |
function vc_remove_wp_ver_css_js( $src ) { | |
if ( strpos( $src, 'ver=' ) ) | |
$src = remove_query_arg( 'ver', $src ); | |
return $src; | |
} | |
add_filter( 'style_loader_src', 'vc_remove_wp_ver_css_js', 9999 ); | |
add_filter( 'script_loader_src', 'vc_remove_wp_ver_css_js', 9999 ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment