List / Month / Today views not working
-
Hi everyone π
The problem is that the urls for the List / Month / Today views get translated, and thus the buttons don’t work on websites that aren’t setup in “English” in WP’s General settings.
=> I’ve come up with a temporary fix, but first of all please read the following disclaimer :
—I’ve only got basic knowledge of JQuery so please forgive me if this code is not optimized—
—Please can an administrator (or experienced developer) validate that this code is safe and ok to run, thanks—1) Create a Javascript file (for example “calendarfix.js”) in your website (for example in your theme’s child-theme folder) containing this code (make sure you replace
https://www.mywebsite.com
with your website’s url)// fixes the views problem in The Events Calendar jQuery(function($) { if ( $( '.tribe-events-c-view-selector__list-item--list a' ).length ) { $('.tribe-events-c-view-selector__list-item--list a').attr("href","https://www.mywebsite.com/events/list") } if ( $( '.tribe-events-c-view-selector__list-item--month a' ).length ) { $('.tribe-events-c-view-selector__list-item--month a').attr("href","https://www.mywebsite.com/events/month") } if ( $( '.tribe-events-c-view-selector__list-item--day a' ).length ) { $('.tribe-events-c-view-selector__list-item--day a').attr("href","https://www.mywebsite.com/events/today") } })
2) Go to Events > Settings > Display
In the “Add HTML before event content” field setup the link to your Javascript file :
<script src="https://www.mywebsite.com/wp-content/themes/twentysixteen-child/calendarfix.js"></script>
(change the url to fit your needs)Hope this helps.
Philippe
- The topic ‘List / Month / Today views not working’ is closed to new replies.