Home › Forums › Calendar Products › Events Calendar PRO › "hide from event listings" override
- This topic has 5 replies, 2 voices, and was last updated 11 years, 3 months ago by
Barry.
-
AuthorPosts
-
January 6, 2015 at 2:10 am #929215
pacovidal
ParticipantGood day!
I have a quite a few of events every day, but I would also like to include long-term exhibitions. The problem is that month, week and even list-type views get cluttered and are difficult to read.
I have two plans to solve it:
A) To use a snippet you posted here: https://theeventscalendar.com/knowledgebase/hide-category-from-calendar-views/ However, I get an error: Notice: Undefined index: eventDisplay in /var/www/vhost/keponen.com/home/html/wp-content/themes/mantra/functions.php on line 55 (your line 3)
B) To use the “hide from event listings” feature in all exhibitions, but make a new page where the “hide from event listings” feature was overriden, if that’s possible, and embed the exhibitions category there (I have Events Rocket installed). This is not so elegant, but I can’t program php and perhaps it would work.
Would you please help me?
Thanks a lot,
Paco
January 6, 2015 at 9:12 am #929395Barry
MemberSo that notice is more a friendly warning than an error as such. You could correct it by adding a new line right above the line in question (so immediately after the function opens):
if ( ! isset( $query->query_vars['eventDisplay'] ) ) return;Does that work for you? (Remember also that, in a live/production environment, you should really have the display of errors turned off!)
January 7, 2015 at 11:17 am #930027pacovidal
ParticipantHi, Barry.
Thank you very much for your help. Yes, perhaps I should turn off the display of errors, but I am new to WordPress and don’t have evrything under control…
I added the code to the snippet and now the notice doesn’t show up, which is great. Now the events in the ‘exposiciones’ category don’t appear in the monthly calendar, but they still do in the upcoming list and week views. Would it be possible to withdraw them from those views too?Sorry for my being so clumsy 🙁
January 7, 2015 at 12:33 pm #930066Barry
MemberI added the code to the snippet and now the notice doesn’t show up, which is great.
Fantastic, I’m glad that worked for you 🙂
Now the events in the ‘exposiciones’ category don’t appear in the monthly calendar, but they still do in the upcoming list and week views. Would it be possible to withdraw them from those views too?
For sure, you can tweak that snippet in various ways. Note how it tests to see which view has been requested before weaving it’s magic:
$query->query_vars['eventDisplay'] == 'month'You could add additional tests for list view and week views (which are simply referred to as list and week). You might also be interested in these template tags:
I hope that helps 🙂
January 7, 2015 at 1:47 pm #930095pacovidal
ParticipantGreat! Thanks very much for your support!
January 7, 2015 at 4:40 pm #930178Barry
MemberOur pleasure 🙂
I’ll go ahead and close this thread since I don’t think there’s much more we can offer for a customization like this one – but I do wish you luck and of course you are more than welcome to post new topics as needed should you require assistance with anything else.
Thanks again!
-
AuthorPosts
- The topic ‘"hide from event listings" override’ is closed to new replies.
