我运行查询:
SELECT post_author
FROM `wp_posts`
看到很多帖子都有作者值1。然后执行搜索。php如下所示:
$args = array(
\'author\' => 1,
);
$the_query = new WP_Query( $args );
没有结果!怎么了?我运行查询:
SELECT post_author
FROM `wp_posts`
看到很多帖子都有作者值1。然后执行搜索。php如下所示:
$args = array(
\'author\' => 1,
);
$the_query = new WP_Query( $args );
没有结果!怎么了?我意识到了问题:
while($the\\u query->have\\u posts()):$the\\u query->the\\u post();;
现在可以了
嗨,我目前正在为我的博客构建一个主题。下面的代码指向最新的帖子(特色帖子)。因为这将有一个不同的风格比所有其他职位。然而我想过滤掉帖子格式:链接使用我在循环中定义的WP查询,因为它给我带来了更多的灵活性。我该怎么做呢? <?php $featured = new WP_Query(); $featured->query(\'showposts=1\'); ?> <?php while ($featured->have_post