"hide from event listings" override

Home Forums Calendar Products Events Calendar PRO "hide from event listings" override

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #929215
    pacovidal
    Participant

    Good 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

    #929395
    Barry
    Member

    So 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!)

    #930027
    pacovidal
    Participant

    Hi, 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 🙁

    #930066
    Barry
    Member

    I 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 🙂

    #930095
    pacovidal
    Participant

    Great! Thanks very much for your support!

    #930178
    Barry
    Member

    Our 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!

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘"hide from event listings" override’ is closed to new replies.