WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] Related posts appear on static pages, not just post pages with 4.0.3 (13 posts)

  1. tcolling
    Member
    Posted 1 year ago #

    After upgrading to version 4.0.3, I have found that related posts appear on static pages, not just on posts, when those static pages include posts using shortcodes. This didn't happen before the new release.

    To see this happen, see my site's home page at http://www.TrustworthyCare.com

    Everything in the left column on that page after the CTA "Call 1-800-777-4750 Today for Your FREE In-Home Assessment!" is a post that is used as an include file with a shortcode plugin called get posts.

    Before taking the upgrade, the list of related posts at the end of the page did not appear.

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    @tcolling, go to the YARPP settings page and make sure the "automatic display" setting has "pages" turned off.

  3. tcolling
    Member
    Posted 1 year ago #

    "make sure the "automatic display" setting has "pages" turned off."

    Yes, it is. This is really weird.

    Any other ideas? I had disabled YARPP after I didn't receive a reply to my post after a day or two, but now I've re-enabled it so that you can see the effect that it has on my home page at http://www.TrustworthyCare.com

    Thanks,
    Tim

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for turning it on again. My guess is that YARPP is being tricked into thinking that it's at the end of a post, not the end of a page, because of the "get posts" shortcode you're running to load some other posts. If you turn off that shortcode, do they go away? Also, are the related posts listed related to your homepage content or to the post(s) that's pulled in by that shortcode?

  5. tcolling
    Member
    Posted 1 year ago #

    "My guess is that YARPP is being tricked into thinking that it's at the end of a post, not the end of a page, because of the "get posts" shortcode you're running to load some other posts. If you turn off that shortcode, do they go away? "

    Yes, they do.

    "Also, are the related posts listed related to your homepage content or to the post(s) that's pulled in by that shortcode?"

    It's a little hard to be sure, but I believe that they're related to the post that is pulled in by the get_posts shortcode. By the way, I have actually replaced the get_posts shortcode plugin with a different plugin called "Display Posts Shortcode" plugin, and YARPP still pulls in the same related posts.

    Here's a relevant question: I'm using these posts as "include files" if you understand what I mean. If I created a custom post type for them, called "includes", instead of just creating them as regular WP Posts, would that trick YARPP into ignoring them?

  6. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Could you post a link to this Display Posts Shortcode plugin you're using? I'd like to try to reproduce this issue myself. Thank you!

  7. tcolling
    Member
    Posted 1 year ago #

  8. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    I just tried installing that plugin, but was unable to reproduce this issue. Here's what I did:

    1. Install that plugin
    2. Create a new page
    3. In that page, call [display-posts tag='algorithm']
    4. In the published page, those many posts were listed, but YARPP was not.

    My YARPP settings were "automatic display" on for posts but not pages. What I got was the expected behavior.

    Am I doing something different than you?

  9. tcolling
    Member
    Posted 1 year ago #

    Hi -

    I followed the steps in your message above, and I can reproduce the problem. The difference is that I use this set of arguments with the shortcode:

    [display-posts tag="home_page" include_content="true" ]

    and it produces the result you can see with the YARPP output, at:

    http://www.trustworthycare.com/358-2/

    So, it appears that the problem may arise when I use the include_content="true" argument with that shortcode.

    Does that help you narrow down what could be causing the problem?

    Thanks! I really appreciate all the time you are taking to look into this.

    Best regards,
    Tim

  10. tcolling
    Member
    Posted 1 year ago #

    Any more progress on this problem?

  11. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Hi - I just tried your modification to my test case. I see that each of the posts' content is being pulled, including their associated "related posts". This is expected: within that context, it thinks it's displaying an archive of posts, and I have "automatic display: posts" turned on, with "Also display in archives" turned on. If I turn off "Also display in archives", it will not display on archives of posts, and therefore it disappears here too.

    So, unfortunately, this is expected behavior and I don't think there's anything on the YARPP side that I'd like to do to circumvent this interaction. I suggest you turn off the "Also display in archives" option. You can manually make it so that related posts are displayed in archives by adding the code related_posts() to your PHP theme files for archives.

  12. tcolling
    Member
    Posted 1 year ago #

    Hi Michael -

    Thank you VERY much for spending so much time looking into this. I really appreciate it.

    One last question: This whole issue arises from my using a special category of posts as "include files" on some static pages. If I created a custom post type (in the WordPress sense) called something other than "Posts", would YARPP ignore those? I could use a plugin that can display custom post types in order to display them on the static pages, if that would prevent YARPP from responding to them.

  13. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Yes, I think that will work. Just make sure the "automatic display" option is not turned on for your new custom post type.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic