【发布时间】:2018-12-05 21:39:44
【问题描述】:
我有一个循环代码,它显示第一个帖子有缩略图而其他帖子不包含它的帖子。但我想把它放在一个特定的类别中..
我的循环如下所示:
<div class="category">
<ul>
<!-- Start the Loop. -->
<?php $i = 1 ; ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<!-- Display the Title as a link to the Post's permalink. -->
<li><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
<?php if ($i == 1): ?>
<?php the_post_thumbnail();?>
<?php endif; ?>
<?php $i++; endwhile; endif; ?>
</ul>
</div>
所以我想用相同样式的特定类别显示这个..
【问题讨论】:
-
你能分享更多细节吗?它是自定义注册分类法还是默认分类法?您希望在此处设置的类别。
-
我将在那里定义任何 cate id.. 我只需要代码..