【发布时间】:2014-06-13 00:17:52
【问题描述】:
我正在开发一个包含帖子滑块(特定类别的帖子)的项目。没问题。但是滑块应该一次显示 4 个帖子(类似于每张幻灯片上的帖子网格)。知道如何解决这个问题吗?这是我用来打印滑块中帖子的代码。这是我的第二个 WordPress 项目,我对 PHP 的了解不多。感谢您的关注,对不起我的英语不好!
<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)
【问题讨论】:
标签: javascript php jquery wordpress