Skip Popover on Event Click

Depending on your use case, you might want your users to go straight to the single post for an event when clicking it on the front-end calendar, instead of displaying the Pie Calendar popover.

To achieve this requires a little bit of JavaScript, provided below:

Note: This JavaScript should be set to load in your website footer.

Also, configure the script to load only on pages where the [piecal] shortcode exists to prevent conflicts.

var ready = (callback) => {

if (document.readyState != "loading") callback();

else document.addEventListener("DOMContentLoaded", callback);

}

ready(() => {

window.calendar?.setOption('eventClick', function(e) { window.location = e.event._def.extendedProps.permalink });

});

Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.