这是我必须做的工作,因为WP不支持我正在尝试的工作
functions.php
add_action(\'init\', \'sort_out_jquery_pngfix_frontend\');
function sort_out_jquery_pngfix_frontend() {
if(!is_admin()) {
wp_deregister_script(\'jquery\');
wp_register_script(\'jquery\', \'https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js\', array(), NULL, true);
wp_register_script(\'dd_belatedpng\', get_stylesheet_directory_uri() . \'/js/dd_belatedpng.js\', array(), NULL, true);
}
}
add_action(\'wp_print_scripts\', \'register_theme_scripts\');
function register_theme_scripts() {
if(!is_admin()) {
wp_enqueue_script(\'modernizr\', get_stylesheet_directory_uri() . \'/js/modernizr-1.7.min.js\', array(), NULL, false);
wp_enqueue_script(\'googlemaps\', \'http://maps.google.com/maps/api/js?sensor=false\', array(), NULL, true);
wp_enqueue_script(\'jquery\');
wp_enqueue_script(\'sc_wc_js\', get_stylesheet_directory_uri() . \'/js/function.js\', array(\'jquery\'), \'1.0\', true);
}
}
footer.php
<?php wp_footer(); ?>
<!--[if lt IE 7]>
<?php wp_print_scripts(array(\'dd_belatedpng\')); ?>
<script>DD_belatedPNG.fix("img, .png_bg");</script>
<![endif]-->