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´m not to good at coding so I could use some help with this! I have a single page which below the post shows more posts from the same category. Then I have another single page which in a similare fashion shows more posts from the same taxonomy term as the current post.

I would like to combine this to show posts from the same category and taxonomy term as the current post.

Code for "same taxonomy term": http://pastebin.com/ebpbzfNi Code for "same category" : http://pastebin.com/kB0n49Bd

If someone would help me with this I would be very grateful!

share|improve this question
up vote 1 down vote accepted

Simply add the 'category__in' => $category_id_array argument from your second query inside your first query.

If this doesn't work, make a tax_query, with both kund and post_category taxonomies

share|improve this answer

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.