我正在使用the_title()
显示自定义帖子类型的标题,但它不起作用;标题不显示。
get_header();
$wp_query = new WP_Query();
$wp_query -> query(\'post_type=press&showposts=20\');
while ($wp_query->have_posts()) :
$wp_query->the_post(); ?>
<div class="press-item">
<div class="press-img"><?php the_post_thumbnail(\'medium\');?></div>
<div class="press-content">
<div class="press-title"><?php the_title(); ?> </div>
<div class="press-excerpt"><?php the_excerpt(); ?> </div>
</div>
</div>
<?php endwhile;
get_footer();