I have been meddling with REST API and I am stuck with this: How can I filter posts in both cat1 and cat2?
?categories=45&categories=50 returns in category ID 45 OR 50 - how can I get posts in 45 AND 50?
Thanks in advance.
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.Sign up to join this community
Multiple categories can be separated by comma like below
hope this helps
You should be able to access multiple categories by using the following:
Hope that helps!
Install the filter plugin Austin mentioned (https://github.com/WP-API/rest-filter) and try
I found out that
%2B is the code equivalent of the
Normally we would use
+ for the AND operator but unfortunately it gets converted into a space so use
This is what I did, It works fine.