Code

The Events Calendar – plugin to delete venues with no events

Photo from Stephen Phillips - Hostreviews.co.uk

I created the function below to clean up venues that have no events associated. You can use a WordPress cron to run it periodically. For ease, I have created plugin you can download below. The plugin adds a “Delete Empty Venues” option to the settings page and runs the function. I used wp_trash_post() rather than […] Read more…

Change “All Events” backlink on The Events Calendar event page

Dorchester Literary Festival website design

This is useful if you have The Events Calendar Pro plugin and use the shortcode to display lists of different event categories on different pages. This code changes the link appearing at the top of the events page. It is especially useful if you have excluded the event category from your main events list. Read more…

The Events Calendar find the available number of tickets for an event

Dorchester Literary Festival website design

This isn’t a particularly clever bit of code, but I’m putting it here as I struggled to find a solution, so hopefully this might help someone. Or me if I need it again and can‘t remember how I did it. First, you will need the id of the event. I have it in my $event […] Read more…

WooCommerce coupon limit quantity by item

Dorchester Literary Festival website design

For the Dorchester Literary Festival website, I used The Events Calendar plugin together with Events Tickets Plus which allows ticket purchasing through WooCommerce. Festival Friends qualify for a 10% discount on ticket purchases. There is a limit to the number of tickets the deal can be applied to per event. Out of the box, no […] Read more…