Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

bossbowser on "Get post ids by category name"

$
0
0

Hi there,

For the life of me I can't work out how to do this one. If anyone can help I will be very very appreciative! Thanks in advance.

I have two arrays each containing category names as values so for instance

Array1 ( [0] => cheap [1] => cheap [2] => average )
Array2 ( [0] => hiphop [1] => charthits [2] => partybangers )

These arrays change each time the page is reloaded to create a more random variation to display to the user

The keys for each array match, so I need to get a list of all post id's for any post tagged in both:
0 > cheap & hiphop
1 > cheap & charthits
2 > average & partybangers

But how would I retrieve an array containing the post id's?? wp_query?

Many thanks in advance.


Viewing all articles
Browse latest Browse all 8245

Trending Articles