Support

Home Forums Event Espresso Premium Exclude category from [ESPRESSO_CALENDAR]

Exclude category from [ESPRESSO_CALENDAR]

Posted: March 31, 2020 at 12:29 pm

Viewing 3 reply threads


cazarinint

March 31, 2020 at 12:29 pm

Follow-up to forum post on hiding category on the ESPRESSO CALENDAR:
https://eventespresso.com/topic/hide-a-category-shortcode-needed/. I am using the code provided by Josh at https://gist.github.com/joshfeck/cb2c0c00e15dbbd3489e35187722a402.

I have tested the code successfully and it removes the events from the calendar but only when this category is the only category assigned to the event. We have multiple categories assigned to events therefore, we need to hide all event having multiple category IDs assigned, but if any are (ID=120) we would like event not to appear in the calendar view.

Can we instead exclude the whole event if it has the category ID=120?


Josh

  • Support Staff

March 31, 2020 at 3:36 pm

Hi,

There is a quick and dirty way to hide those using CSS. For example if the category slug is meeting then this CSS will hide all events categorized with meeting:

.fc-event.meeting {
display: none;
}

There may be another way to do this without CSS. Is there another way these events are unique? For example do they share a common status like “Cancelled” or do they share a common venue?


cazarinint

April 1, 2020 at 8:29 am

Hi & Thank you,
Yes, we are looking into CSS but we have ADA issues to contend with and so it’s not ideal for this site.

I think we could share a common venue or could we use TAG? We currently don’t use TAGs for anything in the events and this would be unique. I believe they are also using “[ONLINE]” at the end of the title but it’s not 100% separate there.

David


Josh

  • Support Staff

April 1, 2020 at 3:45 pm

Hi David,

You can try this snippet instead:

https://gist.github.com/joshfeck/03b70b504f9c0cd5a969a9b44629212e

What that will do is make it so any events that have the online venue will not be included in the calendar.

Viewing 3 reply threads

The support post ‘Exclude category from [ESPRESSO_CALENDAR]’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso