Posted: July 17, 2013 at 10:43 am
|
I would like to add two calendars (each for a different categories). I need the calendars to be separated by text or/and the title of the category to be included in the calendar header. Regardless of where on the page I add the short code for each calendar the two calendars become connected. All text seems to end up above or below the connected calendars. http://www.aspensnowmasstraining.com/certification-training/level-2/ Is there a way to resolve this? |
Hi Jonathan, The calendar wasn’t really intended to be displayed more than once a page, what ends up happening is it gets output into one html div. Which is why your text appears below the calendars. This can be worked around with a bit of jQuery though. You can wrap your text in a paragraph and give it a class so it can be selected easily by using some jQuery. On your calendar page in the editor it will look like this: [ESPRESSO_CALENDAR] <p class="between">Some text</p> [ESPRESSO_CALENDAR] Then you can use a plugin like Insert JavaScript and CSS (or add it to your own custom JavaScript file and load it onto the calendar page) to insert the following JavaScript to the calendar page: jQuery(document).ready(function($) { $('.between').insertAfter('.fc-content:first'); }); What this will do is display the paragraph with the class “between” right after the first calendar. |
|
|
Thank you. I tries following these steps but am still having the same problem. |
Hi Jonathan, I checked the calendar page that you linked to and the jQuery code I posted is no where to be found. Did you add the jQuery? |
|
|
I installed the recommended plugin and copied and pasted the jQuery in to the Insert JavaScript/CSS window. Is there something else that I should be doing? |
Might be the caching plugin you’re running. Since a caching plugin will serve cached versions of the page from before it was changed that could be why. I can suggest an alternate way to inject the JS code to this page. You can add a function like this to the theme’s functions.php file or in /wp-content/uploads/espresso/custom_functions.php: function mcop_custom_script() { if ( is_page(341) ) { ?> <script type="text/javascript"> jQuery(document).ready(function($) { $('.between').insertAfter('.fc-content:first'); }); </script> <?php } } add_action('wp_footer', 'mcop_custom_script'); |
|
|
Thanks I’ll try that. Would it help to delete the cache or deactivate that plugin? |
If you make a change to the site, and it’s not showing up because of caching, deleting the cache will usually help. |
|
|
I have tried deleting the cache and deactivating the caching plugin and the problem still persists. I assume there is an issue with how I am entering the jQuery. I have followed the instructions for the plugin. |
I’d recommend going with the custom function posted here since the plugin is loading the script in the head of the document, which in this case will not work since the calendar scripts are loaded in the footer. I wasn’t aware that the Insert JavaScript plugin only loaded its scripts into the header. This will work for some things, but usually scripts should go in the footer. |
|
|
Got it. I’ll give that a try. thanks. |
You’re welcome. Please let us know how that goes. |
|
The support post ‘Multiple calendars on one page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.