是否可以使用循环来查询特定的帖子,并在我的页面上显示帖子的内容、标题和自定义字段?
我在想:
if (have_posts() && the_post().id == 66) : while (have_posts()) : the_post();
听起来您需要使用query_posts()
,其中p=post_id(1)
<?php query_posts('p=1'); ?>
<?php while (have_posts()) : the_post(); ?>
<?php the_title(); ?>
<?php the_content(); ?>
<?php endwhile; ?>