Help Desk

Event with Same Title Appear only once

  • Posts: 31 Topics: 11 Answers: 1
    | Permalink

    I am using Events Calendar PRO – I have some events that have the same title but cannot be shown once using the tribeHideRecurrence tag because they could not be entered as a recurring event because for example they occur on the same date but at different times say a matinee and then an evening show. Is there a way to have the list only show the performance once in the list if the event title is the same?

    Posts: 10167 Topics: 3
    | Permalink

    Hi Beth and thanks for getting in touch. Welcome back to the forums. ๐Ÿ™‚

    That’s a great question. As you might imagine,ย tribeHideRecurrence only has an impact if the events are in the same recurring series. That means two events can have the same title and still display since they are separate posts in seaprate series.

    One idea might be to create a category called Hidden and remove that category from your calendar display. That would allow you to set the visibility on specific events that you would prefer to hide.

    Would that work for you? Please let me know.

    Cheers!
    Geoff

    Posts: 31 Topics: 11 Answers: 1
    | Permalink

    Is there any query parameter that can be added to the functions.php file. The problem with the category is that multiple people will be entering events from their organizations and I can’t rely on them to ensure that they use the hidden category. If I can programmatically control it it would be much better.

    Posts: 10167 Topics: 3
    | Permalink

    Hi Beth, thanks for following up!

    Yes, excluding an event category programmatically is certainly possible. Check out the solution provided in this threadย as an example and see if that help do the trick for you.

    Cheers!
    Geoff

    Posts: 31 Topics: 11 Answers: 1
    | Permalink

    Geoff,

    Is there anyway for me to SELECT a DISTINCT event_title so the performance could show up only once without having to make sure a category is chosen to exclude it. I am afraid the members entering their events would forget to check the category.

    Thanks
    Beth

    Posts: 10167 Topics: 3
    | Permalink

    Hi Beth,

    That’s a good question. I would imagine it would be possible, but with custom development that is unfortunately outside the scope of support we provide here in the forums. I think either of the recommendations I suggested earlier will work, but customizing beyond that is something I’ll leave to you.

    Please feel free to follow-up with specific questions about the customization as you get started and we’d be happy to try to answer.

    Cheers!
    Geoff

    Posts: 31 Topics: 11 Answers: 1
    | Permalink

    One more question can I use add_action(pre_get_posts) to change the default query that upcoming events uses?

    Posts: 10167 Topics: 3
    | Permalink

    Absolutely! In fact, here is a nice example whereย pre_get_posts was used to randomize events in the main loop of a site. The same idea could be applied to the events loop using conditional wrappers for events loops.

    I’ll go ahead and close this thread since it seems we’ve covered the base question, but do please feel free to start a new thread if you have any other questions here and we’d be happy to help. ๐Ÿ™‚

    Cheers!
    Geoff