Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.