views:

52

answers:

2

I would like to generate all posts that has say a category name of X and a tag name of Y with in wordpress.

 query_posts('cat=X List&tag=Y');

I above works to an extent but not fully since I need to repeat this list and just echo the_title(). The problem is very similar to the one found here http://bit.ly/ba4Zot ,the solutions provided there would be ideal but none work. Any help would be appreciated, thanks in advance!

+2  A: 
$my_query = new WP_Query('category_name=cool&tag=hot');
while ($my_query->have_posts()) : $my_query->the_post();
    the_title();
endwhile;
Rifat
Thank you so much! You're solution was perfect!
CrazyCoderMonkey
ya, but not accepted :P
Rifat
+1  A: 

There are also some plugins out there that should be able to do the trick for you. 'List Category Posts' allows you to just drop in one line of code into the page or post you want listing your category of posts. It allows for multiple variables to be passed through to customize the output, so I would assume it would be easy enough to filter by tags as well as the category. May save you a little time and allow for only particular pages to display categories if you have a variety of types of pages.

jmarx34
You're solution is great too :)
CrazyCoderMonkey