• Resolved bhammondCVL

    (@bhammondcvl)


    How can I exclude from YARPP certain post types? I’m using the plugin to recommend related posts or events, but it also brings in other post types like venues or organizers. I just want posts or events.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Michael Nelson

    (@mnelson4)

    Hi @bhammondcvl, YARPP has a setting called “Display results from all post types” (See https://i.imgur.com/96B1m3c.png). If enabled, YARPP will show related “posts” of any type (posts, pages, events, venues, etc). If disabled, YARPP will only show related “posts” of the same type.

    It sounds like you should make sure that setting is UNchecked, so on posts it will only show related posts, and on events it will only show related events.

    Does that make sense?

    Thread Starter bhammondCVL

    (@bhammondcvl)

    Yes, that does make sense. But I want Posts and Events to display as related, but not anything else. So just limiting things to the same type is not sufficient.

    Plugin Support Michael Nelson

    (@mnelson4)

    Aha, ok then what you’re wanting needs some code in a custom template.

    So to have posts and events suggestion similar posts and events, add this to you theme’s template file:

    
    yarpp_related(
    	array(
    		'post_type' => ['post', 'event']
    	)
    );
    

    Although I’m not sure which event plugin you’re using, so you’ll need to find the custom post type’s exact name, which might be “espresso_events” for Event Espresso, or something else for any of the other plugins. You might need to ask the developer of the event plugin you’re using.

    You’ll probably want to make that change to your theme’s single.php to change it for posts, but for events it again depends on the plugin. This article explains customizing theme template files, but you should probably ask the event plugin’s author which file to customize to change the look of events.

    Also, on the YARPP settings page UNcheck where it says to automatically display related posts on posts and pages.

    Does that make sense? I’m sorry it is a bit technical, which might be more than what you bargained for.

    Thread Starter bhammondCVL

    (@bhammondcvl)

    Awesome! Thanks so much. I will mark this as resolved and give this a try.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Exclude certain post types’ is closed to new replies.