Categories and Event Calendar

Home Forums Calendar Products Events Calendar PRO Categories and Event Calendar

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #989631
    Mark Engebretson
    Participant

    Hello,

    We have a number of events that we show on our events page. We also have three or four exhibits that occur daily at any given time and probably 10 to 12 total exhibits throughout the year. I’d like to be able to use The Events Calendar for these on a separate page our website. In other words, I don’t want them to appear with the other events on the main events calendar page, but appear on a page of the website labeled, “Exhibits.” Is this possible?

    #989811
    Nico
    Member

    Hi Mark,

    Welcome to our support forums, and thanks for reaching out!

    One way to go on this can be to create an Event Category called ‘Exhibit’, then you can see the events for that category in ‘http://your_site_url/events/category/exhibit/’. To exclude it from other view you can add this snippet to the theme’s functions.php file -located at ‘wp-content/themes/your_theme/’:

    add_action( 'tribe_events_pre_get_posts', 'exclude_events_category' );
    function exclude_events_category( $query ) {
    if ( !is_tax(Tribe__Events__Main::TAXONOMY) ) {
    $query->set( 'tax_query', array(
    array(
    'taxonomy' => Tribe__Events__Main::TAXONOMY,
    'field' => 'slug',
    'terms' => array('exhibit'),
    'operator' => 'NOT IN'
    )
    ));
    }
    return $query;
    }

    That should remove ‘exhibit’ events from every view, unless it’s the ‘exhibit’ category view.

    Please try this out and let me know how it goes,
    Best,
    Nico

    #994443
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Categories and Event Calendar’ is closed to new replies.