Skip to content

Instantly share code, notes, and snippets.

@lorenzocaum
Last active November 18, 2015 02:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lorenzocaum/7c1d3dce3c9efe486361 to your computer and use it in GitHub Desktop.
Save lorenzocaum/7c1d3dce3c9efe486361 to your computer and use it in GitHub Desktop.
How to hide tickets with a specific ticket status in the ticket selector in Event Espresso 4

Event Espresso 4 has the following ticket statuses:

  • Archived
  • Sold Out
  • Expired
  • Upcoming
  • On Sale

http://cl.ly/image/20303O3R0c16

Here are CSS examples on how to hide Sold Out -- On Sale on only the event listing page (example.com/events/)

/* Hide ticket options with a status of sold out */
.post-type-archive-espresso_events .ticket-sales-sold-out {display:none;}
/* Hide ticket options with a status of expired */
.post-type-archive-espresso_events .ticket-sales-expired {display:none;}
/* Hide ticket options with a status of upcoming */
.post-type-archive-espresso_events .ticket-pending {display:none;}
/* Hide ticket options with a status of on sale */
.post-type-archive-espresso_events .ticket-on-sale {display:none;}

The examples above can be added to your child theme's stylesheet or a plugin like Reaktiv CSS Builder or My Custom CSS.

Here are CSS examples on how to hide Sold Out -- On Sale on only the event listing page (example.com/events/) and the single event pages (example.com/events/my-new-event/)

/* Hide ticket options with a status of sold out */
.espresso_events .ticket-sales-sold-out {display:none;}
/* Hide ticket options with a status of expired */
.espresso_events .ticket-sales-expired {display:none;}
/* Hide ticket options with a status of upcoming */
.espresso_events .ticket-pending {display:none;}
/* Hide ticket options with a status of on sale */
.espresso_events .ticket-on-sale {display:none;}

The examples above can be added to your child theme's stylesheet or a plugin like Reaktiv CSS Builder or My Custom CSS.

Here are CSS examples on how to hide Sold Out -- On Sale on a WordPress page that uses the ticket selector shortcode (example.com/custom-wp-page/)

/* Hide ticket options with a status of sold out */
.page-id-123 .ticket-sales-sold-out {display:none;}
/* Hide ticket options with a status of expired */
.page-id-123 .ticket-sales-expired {display:none;}
/* Hide ticket options with a status of upcoming */
.page-id-123 .ticket-pending {display:none;}
/* Hide ticket options with a status of on sale */
.page-id-123 .ticket-on-sale {display:none;}

Note: the page ID value should be updated in the examples above. For example, if your page ID was 567, then you should change 123 to 567.

The examples above can be added to your child theme's stylesheet or a plugin like Reaktiv CSS Builder or My Custom CSS.

@lorenzocaum
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment