我是 wordpress 的新手,我正在尝试为一个类别(ID 7)显示自定义 html div。所以这是我的代码..
<?php if(have_posts()) : ?>
<?php is_category( '7' ); ?>
<?php echo 'test'; ?>
<?php while(have_posts()) : the_post(); ?>
<article <?php post_class(); ?>>
<div class="latest-posts">
<div class="latest-posts-info">
<div class="title"><h1><?php the_title(); ?><h1></div>
<div class="text">
<?php the_excerpt(); ?>
</div>
<a href="<?php the_permalink() ?>" class="read-more">Read more...</a>
<div class="clear"></div>
</div>
<div class="latest-posts-img">
<?php //echo get_the_post_thumbnail(); ?>
<?php custom_get_post_attachments(get_the_ID(), $__width, $__height, get_the_title()); ?>
</div>
<div class="clear"></div>
</div>
</article>
<?php endwhile; else: ?>
<div class="content">
<p class="not-found-p">No articles found!</p>
</div>
<?php endif; ?>
它应该显示该类别的 TEST,但它没有。怎么了?
谢谢!