WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] [Plugin: Yet Another Related Posts Plugin] YARPP with different post types ("portfolio") (6 posts)

  1. altoidboy
    Member
    Posted 1 year ago #

    I just switched WP templates from one in which all my articles were regular WP posts, over to one where I had to convert them to a custom post type ("portfolio"). I'm trying to figure out how to configure/mod YARPP to still display all related portfolio items at the bottom of a portfolio item, just like it used to when they were regular WP posts.

    I tried reading the documentation but couldn't understand how to implement this. Any chance anyone can give me some tips?

    Thanks in advance!

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

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    The first step would be to set 'yarpp_support' => true in the code where you're registering your custom post type, portfolio. Then YARPP will be aware of these posts. Then, in YARPP's settings, make sure the "cross-relate across all post types" option is set.

  3. altoidboy
    Member
    Posted 1 year ago #

    Thanks very much for the reply. I'm not fluent in PHP and I've never done this before -- but I think I figured some of it out. I did find register_post_type in my functions.php and successfully added this code:

    'yarpp_support' => true,

    and that caused "portfolio" to show up in the YARPP backend.

    I then looked for cross-relate, but couldn't find it anywhere. I did find "Display results from all post types" so I enabled that. Am I missing this feature somewhere? (I'm running the latest 3.5.3.) Currently, related portfolio items aren't appearing at the bottom of portfolio items.

    I really appreciate the help!

  4. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, that's right; "cross-relate" was recently relabeled "display results from all post types."

    If you want to display related items on the portfolio pages, you'll have to add the code related_posts() into your theme's code for those portfolio pages. Just add it below the_content() and you should be set.

  5. altoidboy
    Member
    Posted 1 year ago #

    Got it working! Except I had to use related_entries() since mine are portfolio entries.

    Thanks so much for the help!

  6. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    No problem. :D

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.