嗨,我想在一个页面上使用 flexslider 两次。我找到了这个教程:http ://www.myjqueryplugins.com/comment/reply/33但是没有运气。下面是我在函数文件中的代码。有人知道我可能会出错吗?
function anaximander_flexslider() {
if (!is_admin()) {
// Enqueue FlexSlider JavaScript
wp_register_script('jquery_flexslider', get_template_directory_uri(). '/js/jquery.flexslider-min.js', array('jquery') );
wp_enqueue_script('jquery_flexslider');
// Enqueue FlexSlider Stylesheet
wp_register_style( 'flexslider-style', get_template_directory_uri() . '/CSS/flexslider.css', 'all' );
wp_enqueue_style( 'flexslider-style' );
// FlexSlider custom settings
add_action('wp_footer', 'anaximander_flexslider_settings');
function anaximander_flexslider_settings() { ?>
<script type="text/javascript" charset="utf-8">
$(window).load(function() {
$('#main-slider').flexslider({
animation: 'slide',
controlsContainer: '.flex-container'
});
$('#logo-slide-show').flexslider();
});
</script>
<?php
}
}
}
add_action('init', 'anaximander_flexslider');