Home › Forums › Calendar Products › Events Calendar PRO › Exclude Category from Calendar View
- This topic has 3 replies, 3 voices, and was last updated 11 years ago by
Support Droid.
-
AuthorPosts
-
May 1, 2013 at 8:05 am #47354
UNC Web Services
ParticipantI 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!
May 1, 2013 at 8:30 am #47358UNC Web Services
ParticipantStumbled across this simliar thread:
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… 🙂
May 1, 2013 at 9:01 am #47363Jonah
ParticipantGreat, glad you figured it out Jeff! If there’s anything else you need help with please let us know.
July 7, 2015 at 6:26 am #979019Support Droid
KeymasterThis 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. -
AuthorPosts
- The topic ‘Exclude Category from Calendar View’ is closed to new replies.
