Exclude Category from Calendar View

Home Forums Calendar Products Events Calendar PRO Exclude Category from Calendar View

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #47354
    UNC Web Services
    Participant

    I am working on a custom events integration and have created a custom taxonomy (special => ongoing) that I am using to display “ongoing” events on the sidebar in their own custom display. That is working well. 🙂

    What I need to do is exclude the any listings with this taxonomy from the main displays for archive pages. I have done that just fine in the upcoming view (/events/category/arts/upcoming/) by adding the following function to the top of my ecp-page-template.php.

    function excludeongoing () {
    global $wp_query;
    $newargs = array(
    ‘tax_query’ => array(
    ‘relation’ => ‘AND’,
    array(
    ‘taxonomy’ => ‘special’,
    ‘field’ => ‘slug’,
    ‘terms’ => ‘ongoing’,
    ‘operator’ => ‘NOT IN’,
    )
    )
    );
    $args = array_merge( $wp_query->query_vars, $newargs);
    query_posts($args);
    }

    What I can’t seem to do is find a way to control the query that is pulling in the events for the calendar grid view (/events/category/arts/month/). I would think the page template would do it, but it seems to still show my ongoing events. I tried adding it to the table.php and gridview.php as well. Where is that query for the calendar coming from?

    Thanks for your help!

    #47358
    UNC Web Services
    Participant

    Stumbled across this simliar thread:

    Exclude One Category from Upcoming Events List

    I didn’t need to exclude it from all views, but I was able to modify the solution to include a conditional statement for the month:

    || $query->query_vars[‘post_type’] == TribeEvents::POSTTYPE && $query->query_vars[‘eventDisplay’] == ‘month’

    I think I’m good now… 🙂

    #47363
    Jonah
    Participant

    Great, glad you figured it out Jeff! If there’s anything else you need help with please let us know.

    #979019
    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 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Exclude Category from Calendar View’ is closed to new replies.