Support

Home Forums Event Espresso Premium Hidden Events

Hidden Events

Posted: August 13, 2019 at 7:02 am


Wassim Zeidan

August 13, 2019 at 7:02 am

I want to create a ticket that will not show in the events list page (Archive) and it can only be accessed by a direct link.

I tried to make the event private but it didn’t show to the public, so I changed it to password protected but it showed in the Events List (Archive)

Back in EE3 I used to make the event as a wait list but this is not available in EE4


Tony

  • Support Staff

August 13, 2019 at 7:52 am

Hi there,

One option is to use the snippet here:

https://eventespresso.com/topic/hiding-events-from-the-event-list/#post-264089

Tag your events as hidden and set the term_taxonomy_id to be the correct ID for your tag on this line:

$SQL .= " AND ID NOT IN (SELECT object_id FROM {$wpdb->term_relationships} WHERE term_taxonomy_id=186 )"; // change to hidden tag ID

Events tagged as hidden will not be visible on the event lists.


Josh

  • Support Staff

August 13, 2019 at 7:56 am

Hi,

Alternatively, you could add this code:

https://gist.github.com/joshfeck/31c5055be20e5e4dfaf333ab7a4090e9

Which will remove any events you specify from the events list page (Archive).


Wassim Zeidan

August 13, 2019 at 8:59 am

Hi Josh, the 2nd solution is much easier but when I applied it, it worked on the Event Archive page but if you check the Custom Events List topic which I created earlier, I added a custom page to display the tickets which is displaying all the events including the ones that are hidden in the Events Archive page


Josh

  • Support Staff

August 13, 2019 at 9:48 am

That would be expected because the code I shared with you includes a conditional that only returns true if it’s the main query, which the shortcode is not the main query.

What you can do is add on more to the conditional to allow the same to apply to a page with the Event Espresso shortcode. e.g change this:
if ( ! is_singular() && $query->is_main_query() ) {
to this:

if (
  ! is_singular() && $query->is_main_query() || 
  is_page() && $query->get_queried_object()->name == 'espresso_events'
) {

The support post ‘Hidden Events’ 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