WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] Both related posts, and related custom post types, but SEPARATELY (3 posts)

  1. nathanielstern
    Member
    Posted 2 years ago #

    Currently, I have YARPP being called on posts, and on a custom post type, as a list of each. I am using an if statement in my template so that it either says "related posts: [list]" or "related artworks: [list]", depending on the kind of page we are on. What I'd really like is for both to appear on both, but separately. Not a mix of both posts and artworks in one list - which I know the plugin already can do in its settings - but rather, at the bottom of each page, it would show "related posts: [list]" AND "related artworks: [list]", separately. Is there an easy way to do this - call it using built-in settings but just define the post-type? Or do I have to re-list ALL my args? Also, can I do this in the YARPP template, just recall each and then format, or do I have to put it in my post templates?

    Thanks in advance!

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

  2. nathanielstern
    Member
    Posted 2 years ago #

    OK, while I could not do it within the YARPP template, I could call it from my theme, twice, and it seems to use the same settings other than the one I overwrite. So I do this:

    <div style="font-size:.9em; line-height:1.5;">Related artworks: <?php yarpp_related(array('post_type' => array('portfolio'))); ?><br />
    Related press: <?php yarpp_related(array('post_type' => array('post'))); ?><br /></div>

    And we're happy!

  3. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 2 years ago #

    Yup! That's exactly what I would have suggested. :) For the second one, you can probably just use related_posts(), though.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic