Similar Posts
not showing any posts (3 posts)

  1. deepbevel
    Posted 5 years ago #

    I've configured the plugin to show posts with the same tag, category and author. but it says "none found" even though all posts in a single category have the same tag, and same author. They are private posts so I set it accordingly. I'm using the widget. Is there something else I have to do? does it not work in an archive? Although it doesn't return any results an post single either.


  2. Gadgetgod
    Posted 5 years ago #

    Hi Deepbevel, try installing the "Post-Plugin Library" plugin aswell and let me know if it works :)


  3. deepbevel
    Posted 5 years ago #

    I did install that first, as instructed. It just wouldn't show any results. However I found code that gives me exactly what I was looking for:

    //for use in the loop, list 5 post titles related to first tag on current post
    $tags = wp_get_post_tags($post->ID);
    if ($tags) {
      echo 'Related Posts';
      $first_tag = $tags[0]->term_id;
        'tag__in' => array($first_tag),
        'post__not_in' => array($post->ID),
      $my_query = new WP_Query($args);
      if( $my_query->have_posts() ) {
        while ($my_query->have_posts()) : $my_query->the_post(); ?>
          <p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>

    It's odd though, I tried about 7 plugins which are supposed to return posts of the current tag, none worked. Why this code can do it I'll probably never know.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Similar Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic