Javascript Wordpress滑块,每个幻灯片有4个帖子
我正在做一个项目,它有一个滑动的帖子(一个特定类别的帖子)。没问题。但是滑块应该一次显示4个帖子(类似于每张幻灯片上的帖子网格)。你知道我怎么解决这个问题吗?这是我用来在滑块中打印帖子的代码。这是我的第二个WordPress项目,我对PHP不太了解。谢谢你的关注,对不起我的英语不好Javascript Wordpress滑块,每个幻灯片有4个帖子,javascript,php,jquery,wordpress,Javascript,Php,Jquery,Wordpress,我正在做一个项目,它有一个滑动的帖子(一个特定类别的帖子)。没问题。但是滑块应该一次显示4个帖子(类似于每张幻灯片上的帖子网格)。你知道我怎么解决这个问题吗?这是我用来在滑块中打印帖子的代码。这是我的第二个WordPress项目,我对PHP不太了解。谢谢你的关注,对不起我的英语不好 <ul class="slides"> <?php query_posts(array('category_name' => 'marcar-na-timeline')); if(have_p
<ul class="slides">
<?php
query_posts(array('category_name' => 'marcar-na-timeline'));
if(have_posts()) : while(have_posts()) : the_post();
?>
<li>
<ul>
<li class="item">
<a href="<?php echo get_permalink(); ?>" class="post-item-container<?php echo $opener_class; ?>">
<div class="thumb"><?php the_post_thumbnail('thumbnail');?></div>
<div class="item-content">
<div class="date">
<span class="day"><?php the_time('d'); ?></span>
<span class="monthandyear"><?php the_time('M y'); ?></span>
</div>
<div class="item-description">
<?php echo get_uf('description'); ?>
</div>
<div class="clear"></div>
</div>
</a>
</li>
</ul>
</li>
<?php
endwhile;
endif;
wp_reset_query();
?>
</ul>
-
-
(我正在使用flexslider)使用WP\u查询类:
$slider_post= new WP_Query('category_name='your catagory name'& showposts=4');
if($slider_post -> have_post()) : while($slider_post->have_post()){
$slider_post->the_post();
// echo html slider item
}
我希望它对你有用