Ready to get started?Download WordPress


Can I pass a post_type array to the api? (1 post)

  1. lisota
    Posted 1 year ago #

    I am trying to retrieve a query of two post types. By default, the api returns posts. I want posts, plus my custom post type called "events".

    Is it possible to pass an array to the post_type query parameter? If so, what is the syntax. If not how would I achieve combining two (or more) different post types in my query?

    On my site, I've changed the query parameters for the category archive page to include my custom post type in addition to posts. However, the JSON API apparently uses its own query or modifies those query parameters.


Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic