我为特定类别创建了帖子模板,其中包括缩略图,标题,摘录,并且我使用自定义内容向模板添加了额外的div,这将自动生成,让它为div class =“custom”。我还在博客页面上创建了一个循环,显示了此特定类别的所有帖子。我知道如何显示缩略图,标题,摘录,但不知道如何显示.custom。我该如何创建这个循环?谢谢
<?php
if ( have_posts() ) :
query_posts('cat=1');
while (have_posts()) : the_post();
?>
<div class = "programs-flex-item">
<div class = "programs-flex-item__title"><?php the_title(); ?></div>
<div class = "programs-flex-item__image"><?php the_post_thumbnail(); ?></div>
<div class = "programs-flex-item__excerpt"><?php the_excerpt(); ?></div>
<div class = "custom">HERE IS CUSTOM CONTENT!!!</div>
</div>
<?php
endwhile;
endif;
wp_reset_query();
?>