• Resolved monnibo

    (@monniblog)


    I’m using Tribe Events Calendar, and in the Single View page for events, the Related Posts from Jetpack are showing. The biggest problem is that they appear before the event details (time/date/location). You can see it here

    I tried using the following code to exclude JP’s Related Posts on a specific category, but it didn’t work

    
    function jetpackme_filter_exclude_category( $filters ) {
        $filters[] = array( 'not' =>
          array( 'term' => array( 'category.slug' => 'event' ) )
        );
        return $filters;
    }
    add_filter( 'jetpack_relatedposts_filter_filters', 'jetpackme_filter_exclude_category' );
    • This topic was modified 7 years, 5 months ago by monnibo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • That code you added will stop any of your events from appearing in the related posts section – I would suggest keeping that code in if you don’t want to your events to show as related posts.

    Can you try the below code to stop related posts from showing on your events.

    function jetpackme_no_related_posts( $options ) {
    if ( is_singular( ‘tribe_events’ ) ) {
    $options[‘enabled’] = false;
    }
    return $options;
    }
    add_filter( ‘jetpack_relatedposts_filter_options’, ‘jetpackme_no_related_posts’ );

    Thread Starter monnibo

    (@monniblog)

    Just wanted to come back to say that worked perfectly! Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Related Posts on Events Plugin’ is closed to new replies.