• Resolved caroline

    (@makeupedia)


    I noticed that when I use this shortcode, it doesn’t show the same related posts as when it is automatically displayed.

    Why is that? Am I using the wrong code?

    
    
    <?php related_posts($post->ID); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Michael Nelson

    (@mnelson4)

    Hi @makeupedia, sorry it’s not working as intended.
    You’re using that function fine. It should show the same results as when related results are added automatically, but there’s a bug that makes YARPP show different results depending on when it’s called. We’re hoping to have a fix out for this issue ASAP, at which point you can retry it.

    Plugin Support Michael Nelson

    (@mnelson4)

    Oh actually I just uncovered something else: you may want to try yarpp_related() instead of related_posts(). The function related_posts() ignores the “post_type” parameter you pass it (which is probably a bug), and it’s possible that’s what’s causing your different results.

    Plugin Support Michael Nelson

    (@mnelson4)

    actually, our recommended approach is to do do_shortcode('[yarpp]');

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Shortcode showing random related posts’ is closed to new replies.