Take the 2-minute tour ×

I'm trying to filter my posts by category, then further by city. The only way I can think of filter by city is if the admin adds the city to the listed tags and then filtering from there via switch statement.

How can I filter posts by a certain tag?

Is there a better way to do what I'm doing?

My PHP knowledge is intermediate and my Wordpress knowledge is pretty basic. Thanks in advance!

share|improve this question

1 Answer 1

up vote 2 down vote accepted

here you go,

The following returns all posts that belong to category 1 and are tagged "apples"

query_posts( 'cat=1&tag=apples' );

Add this inside the page before the loop

change '1' and 'apples' to whatever category and tag you want.


look here for more info,


share|improve this answer
Great Thanks!!! –  Howdy_McGee Jan 25 '12 at 18:18

Your Answer


