小编Alp*_*ati的帖子

如何在WordPress中显示所有帖子?

我想在我的 WordPress 主页中显示所有帖子。

我写了以下查询以获取所有帖子,但我没有收到所有帖子。它只显示 10 或 11 个帖子:

 $args = array(
                'post_type' => 'post',
                'posts_per_page' => $number,
                'order' => $sort_by,
                'orderby' => 'title',
                'post_status' => 'publish',
                'tag' => $tags,
                'ignore_sticky_posts' => 1,
                );
 $args['tax_query'] =  array(
                    array(
                    'taxonomy' => 'post_format',
                    'field' => 'slug',
                    'terms' => 'post-format-video',
                    ));
 $query = new WP_Query($args);
Run Code Online (Sandbox Code Playgroud)

所以请让我知道如何获得所有帖子。

wordpress

8
推荐指数
1
解决办法
3万
查看次数

标签 统计

wordpress ×1