WordPress.org

Support

Support » Plugins and Hacks » WP REST API (WP API) » Querying posts according to custom taxonomy term?

Querying posts according to custom taxonomy term?

  • Does the api support the same query vars as standard WordPress queries?

    suppose I have a taxonomy called location, normally in WordPress I would write

    www.mysite.com/?location=my-term

    to get results for “my-term” taxonomy archive

    I tried to do that with the JSON API

    www.mysite.com/wp-json.php/posts/?location=my-term

    but it doesn’t work – is this supported?

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

Viewing 1 replies (of 1 total)
  • Try this:
    http://www.mysite.com/wp-json/posts?filter[location]=my-term

    Syntax:
    http://api-endpint/wp-json/posts?filter[query-variable]=value

Viewing 1 replies (of 1 total)
  • The topic ‘Querying posts according to custom taxonomy term?’ is closed to new replies.
Skip to toolbar