我添加了Flexslider,站点 http://test06.menchasha.ru/。标头中的代码:
<script type="text/javascript"> (function($) {
jQuery(window).load(function() {
jQuery('#featured-image-slider .flexslider').flexslider({
animation: 'slide',
slideshowSpeed: 9000,
animationSpeed: 900,
pauseOnAction: true,
pauseOnHover: true,
controlNav: false,
directionNav: true,
controlsContainer: "#featured-image-slider",
});
})
})(jQuery)</script>
首页代码:
<section id="featured-image-slider">
<div class="flexslider">
<ul class="slides">
<?php query_posts(array('post_type' => 'Sliders','orderby' => 'rand')); if(have_posts()) : while(have_posts()) : the_post();?>
<li class="slide">
<?php the_title(); ?>
<?php the_excerpt(); ?>
<?php the_post_thumbnail(); ?>
</li>
<?php endwhile; endif; wp_reset_query(); ?>
</ul>
</div>
</section>
正确包含脚本和样式。但是滑块没有显示我的自定义帖子类型。你能帮忙吗?
谢谢!
有关详细信息,请阅读问题中的评论:
该错误来自在查询中使用post_types名称。
它应该是注册的帖子类型标识符。
意义
'post_type' => 'Sliders'
应该是
'post_type' => 'acme_product'