display related post by taxonomy
-
Hi Guys
I want to show related posts, with the same taxonomy (artists) as the current post. In the realted post I dot want the current post to appear.
I am also using a custom post type. (sculptures)
This is the code i am using below, but it is showing the current post in the realted post and all post not only those with the taxonomy (artists”)
Does anyone have a solution
<div class=”related-posts”>
<h3 class=”widget-title”>Related Posts</h3>-
<?php
$query = new WP_Query(array(‘post_type’ => ‘sculptures’, ‘artist’ => get_the_term_list( $post->taxonomies, ‘artist’ )));
while ($query->have_posts()) : $query->the_post();
?><div class=”related-thumb”>” rel=”bookmark” title=”<?php the_title(); ?>”><?php the_post_thumbnail(‘medium’); ?></div>
<?php endwhile; wp_reset_query(); ?>
</div>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘display related post by taxonomy’ is closed to new replies.