获取当前页面中 post 的总数
Getting total number of post in current page
我试图在使用分页时显示当前页面中 post 的数量。在我使用的所有页面中,总共 posts $query->found_posts;
。但是,我不知道如何在每页上计算 post 。例如,我想显示 Showing 5 of 50 posts 知道吗?
提前致谢。
与found_posts
类似,还有post_count
,表示“当前查询的帖子数”。所以你可以使用 $query->post_count
.
我试图在使用分页时显示当前页面中 post 的数量。在我使用的所有页面中,总共 posts $query->found_posts;
。但是,我不知道如何在每页上计算 post 。例如,我想显示 Showing 5 of 50 posts 知道吗?
提前致谢。
与found_posts
类似,还有post_count
,表示“当前查询的帖子数”。所以你可以使用 $query->post_count
.