Yet Another Related Posts Plugin (YARPP)
Not showing in template but with Automatical Display (5 posts)

  1. gothbarbie
    Posted 3 years ago #

    When I use: <?php if(function_exists('related_posts')) related_posts(); ?> in my template (single.php), I get "no results", but if I use the setting in the options "Automatically display:" I do get results.

    Why is this?

    I use Custom Post Type and Taxonomy. Do I need to add something more in the template function request for this to work?


  2. mitcho (Michael Yoshitaka Erlewine)
    Plugin Author

    Posted 3 years ago #

    Hmm, that's odd. Are you using version 4 of YARPP? Have you had similar trouble with previous versions?

    Did you place related_posts() in your theme inside The Loop on that page? For example, what if you put it *right* after the_content()?

  3. gothbarbie
    Posted 3 years ago #

    I just installed the plugin locally, so it should be the newest. :) I haven't used it before, so I can't comment on older versions, unfortunately.

    If I put the related_posts() directly after the_content() I get the same result ("No results"), just displayed at another position. Nothing else seems to change.

    The weird thing to me is it works fine if I use the auto display, but not the manual one inside my theme, in single.php. I was thinking perhaps there is some parameter missing?

    Is the code when inserted automatically identical to the manual inserted one in the plugin?

    The only reason I insert it manually is because I want it displayed at another position with some other stuff in-between my the_content() and related_posts().

  4. gothbarbie
    Posted 3 years ago #

    I use the thumbnail template, if that helps. :)

  5. mitcho (Michael Yoshitaka Erlewine)
    Plugin Author

    Posted 3 years ago #

    No, you shouldn't have to enter any parameter with related_posts()... the code should be identical. :(

    What if you try calling related_posts(array(), get_the_ID())? Also, try adding the_ID() so that you see what post ID it's looking for related posts for... make sure that that matches your current post.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yet Another Related Posts Plugin (YARPP)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic