我只想在特色幻灯片中显示3篇帖子,但它被忽略了,显示了很多帖子。如何修复它?
$my_query = new WP_Query(
array(
\'posts_per_page\' => 3,
\'post_id\' => $featitem
)
);
while ($my_query->have_posts()) :
$my_query->the_post();
我只想在特色幻灯片中显示3篇帖子,但它被忽略了,显示了很多帖子。如何修复它?
$my_query = new WP_Query(
array(
\'posts_per_page\' => 3,
\'post_id\' => $featitem
)
);
while ($my_query->have_posts()) :
$my_query->the_post();
post_id
不是WP_Query
参数也许你是说post__in
? 如果是,那么$featitem
需要是一个post ID数组。
嗨,我目前正在为我的博客构建一个主题。下面的代码指向最新的帖子(特色帖子)。因为这将有一个不同的风格比所有其他职位。然而我想过滤掉帖子格式:链接使用我在循环中定义的WP查询,因为它给我带来了更多的灵活性。我该怎么做呢? <?php $featured = new WP_Query(); $featured->query(\'showposts=1\'); ?> <?php while ($featured->have_post