The calendar created using Sawfish plugin loads event links in a new tab by default. Here’s how to make them load in the same page.
Add the below code after the Calendar shortcode to load the event links in the same page.
You can double-click on the code below to select all and copy paste to your page. 😃
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', function() {
const links = document.querySelectorAll('a.fc-event');
links.forEach(function(link) {
link.addEventListener('click', function(e) {
e.preventDefault();
e.stopPropagation();
window.location.href = link.href;
});
link.removeAttribute('target');
});
});
</script>Haven’t set up your Salesforce Calendar on WordPress yet? Connect any Salesforce object on WordPress using Sawfish Plugin:
How to Show Salesforce Event Calendar and Link to Detail Page on WordPress (with Example)