Skip to content

Any way to get total posts count? #255

@proleskovskiy

Description

@proleskovskiy

Hello!

According to the official docs:
https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/

"To determine how many pages of data are available, the API returns two header fields with every paginated response:
X-WP-Total: the total number of records in the collection
X-WP-TotalPages: the total number of pages encompassing all available records"

I query posts using await client.Posts.Query(query), with 'Page' and 'PerPage' parameters set, but this method only returns posts. Is there a way to get total posts count without actually loading all of them with client.Posts.GetAll()?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions