Wordpress REST API - get custom taxonomy category posts

Viewed 260

I want to use Wordpress REST API to get the posts that are inside a custom taxonomy created by the theme.

The taxonomy is called "my_portfolio" but if I use this I have this response:

{"code":"rest_no_route","message":"Nessun percorso fornisce una corrispondenza tra l'URL ed il metodo richiesto.","data":{"status":404}}

Instead if I use "my_portfolio_category" I have 4 categories that are called: "photo", "video", "design", "web".

I want to retrieve the posts inside the category "photos" but the only thing I managed to get is the category info.

The API I used is the one down below where 921 is the ID of the category "photo", using the slug doesn't work.

https://www.mywebsite.com/wp-json/wp/v2/my_portfolio_category/921

Is there a way to get the posts? If this is not possible it could be helpful getting just the posts inside the taxonomy without dividing them into categories.

0 Answers
Related