WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[Plugin: Yet Another Related Posts Plugin] Placement in sidebar.php gives same result on all posts (3 posts)

  1. mskogly
    Member
    Posted 4 years ago #

    Added yarpp to my sidebar using this code if ( is_single() && function_exists('related_posts') ) {
    related_posts();
    }

    but for some reason I keep getting the same posts. If I use the automatic option instead and let the plugin automatically insert the related posts, it seems to work perfecly.

    Any ideas?

  2. mskogly
    Member
    Posted 4 years ago #

    Update: When I use it in the sidebar, I get a list of related posts for the very last post I list in my other loop. I list the six latest posts with thumbs in the sidebar before I call related_posts(), using new WP_Query.

    <?php $recent = new WP_Query("cat=44&showposts=6"); while($recent->have_posts()) : $recent->the_post();?>

    Can it be related to this?

  3. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 4 years ago #

    Most likely your sidebar is out of The Loop, so it doesn't get information on what post is being displayed. Why not use the builtin YARPP widget?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic