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.

1 Answer 1


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.

  • 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, 2013 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, 2013 at 15:47
  • Ok thanx all answer
    – Genxer
    Jan 13, 2013 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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