WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to list all posts that appear in the current category being viewed that are also posted to a second category.

Example Pictures : LINK

For instance, a listing of the common posts between the Headline category and the Media category if Media is currently being viewed.

share|improve this question

I think that all you need is this, from the Codex:

$query = new WP_Query( 
    'category__and' => 
    array( 2, 6 ) 

Where the numbers (2, 6) are your category IDs. Your question does not have enough detail, or enough code, for me to tell you how to implement that inot your page.

share|improve this answer
Thank you for answer s_ha_dum.. I want this dynamic (cat id)..So if i in Media category, then i want see this in sidebar, Headline and Media post list, if in internet then i want see Headline and Internet post list ( common post list) sorry for bad english.. – Genxer Jan 13 '13 at 10:45
Yes, I know what you want but you didn't post any code so that is about the best I can do. – s_ha_dum Jan 13 '13 at 15:47
Ok thanx all answer – Genxer Jan 13 '13 at 15:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.