Support » Plugin: Yet Another Related Posts Plugin (YARPP) » Both related posts, and related custom post types, but SEPARATELY

  • Resolved nathanielstern


    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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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!

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Both related posts, and related custom post types, but SEPARATELY’ is closed to new replies.