Get related posts by custom taxonomy

In this post we’re going to useΒ wp_queryΒ andΒ custom taxonomies.

What we want is to retrieve posts related to the one we are currently displaying through one (or more) custom taxonomy term by using the following snippet to retrieve the current post type and use it in creative ways. In my case, since I was out of creativity, I just chose to run a simpler query whenever the post_type is not "event. Check it out.

Credits go mainly to Smashing Magazine and hours of Googling in order to search for an easy solution.

Leave a Reply

Your email address will not be published. Required fields are marked *