Remove event category from list view

Home Forums Calendar Products Events Calendar PRO Remove event category from list view

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1325627
    Jaap
    Participant

    Hi,

    Since the last update the custom code to remove a category from a list view is no longer working. It’s this code:

    dd_action( ‘pre_get_posts’, ‘tribe_exclude_events_category_month_list’ );
    function tribe_exclude_events_category_month_list( $query ) {

    if ( isset( $query->query_vars[‘eventDisplay’] ) && ! is_singular( ‘tribe_events’ ) ) {

    if ( $query->query_vars[‘eventDisplay’] == ‘list’ && ! is_tax( Tribe__Events__Main::TAXONOMY ) || $query->query_vars[‘eventDisplay’] == ‘month’ && $query->query_vars[‘post_type’] == Tribe__Events__Main::POSTTYPE && ! is_tax( Tribe__Events__Main::TAXONOMY ) && empty( $query->query_vars[‘suppress_filters’] ) ) {

    $query->set( ‘tax_query’, array(

    array(
    ‘taxonomy’ => Tribe__Events__Main::TAXONOMY,
    ‘field’ => ‘slug’,
    ‘terms’ => array( ‘oefenuur’ ),
    ‘operator’ => ‘NOT IN’
    )
    ) );
    }

    }

    return $query;

    What can I do to fix this?

    Cheers,
    Jaap

    #1326638
    Barry
    Member

    Hi Jaap,

    Sorry to hear it.

    I do have to note first of all that we can’t typically provide in-depth support for custom code and, even if this was sourced from a staff reply or a knowledgebase article, please do understand that the intent is generally to get you started — realistically, we can’t commit to ongoing support and maintenance of every snippet of code that’s out there.

    I’ll be happy to try and point you in the right direction if I can, though. To start with, can you point me to the source of this code?

    Thanks!

    #1327320
    Jaap
    Participant
    #1327632
    Barry
    Member

    Thanks for clarifying, Jaap.

    The snippet basically seems sound to me and it works locally (of course, I need to change the category slug to something that matches my local data, but otherwise it’s fine).

    In your case you seem to be targeting categories with the slug “oefenuur” – but when I visit the archive for that event category I see no upcoming events. Might that explain why it seems to have no effect?

    #1337756
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Remove event category from list view’ is closed to new replies.