Is it possible to fetch posts matching categorie x “AND” tag y?
Read the docs, it seems you can do:
query_posts('tag=bread,baking');
or
query_posts('cat=2,6,17,38');
… is it possible to use both cat and tag simultaneously?
Is it possible to fetch posts matching categorie x “AND” tag y?
Read the docs, it seems you can do:
query_posts('tag=bread,baking');
or
query_posts('cat=2,6,17,38');
… is it possible to use both cat and tag simultaneously?
You must be logged in to post a comment.
I am not a WordPress expert, but what I see from looking up that function, is that you should be able to use this notation in order to query against both at the same time.
This is taken from another question that I had answered previously and it was tested and worked properly, so here we go. You can manually query your database using the following:
All that you would do is that you would provide the termID for each of the tags/categories that you want to find.
I’m not sure if it would work or not, but technically tags and categories are within the same table. So, I would think that if you provide the tagID within the cat= parameter it might work, I don’t have a chance to test it currently, but definitely worth a try.
Yes, you can. I recently had to show all future posts on a page of my wordpress log and I just used:
which worked flawlessly.