WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Retrieve Posts by Category ID or slug

[Resolved] Retrieve Posts by Category ID or slug

  • Hello,
    Is there any REST API for retriveing all the published posts from a specific category by category slug or category ID?

    Can you post an example URI, please?
    And more in general: which is the query scheme for retrieving posts by categories, tags, or custom fields if there is one?

    Thank you very much in advance,
    Gianpaolo

    https://wordpress.org/plugins/json-rest-api/

Viewing 1 replies (of 1 total)
  • Plugin Author Ryan McCue

    @rmccue

    Is there any REST API for retriveing all the published posts from a specific category by category slug or category ID?

    You can pass any parameters marked as public to WP_Query through via the filter parameter.

    In this case, you can do either /posts?filter[cat]=12 or /posts?filter[category_name]=my_cat_slug

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] Retrieve Posts by Category ID or slug’ is closed to new replies.