Support

Home Forums Event Espresso Premium Calendar not showing on parallax home page, working fine on regular page

Calendar not showing on parallax home page, working fine on regular page

Posted: December 29, 2015 at 1:54 pm


Railpromo

December 29, 2015 at 1:54 pm

Dear support theme,

Upon testing the feasibility of switching to Event Espresso, I’m encountering an issue with the Onetone theme.

On our site, the calendar shortcode/tag does not produce a result if included in the one page homepage of the theme. It’s there, in the source code, but without width and height and not populated. Including the tag on a regular WordPress page shows the calendar without any problem.

Searching the forum, I found a number of references to Javascript errors, but couldn’t find that causing the problem at hand.

Using: EE4 and WordPress 4.4.

Do you have any advice as to what might cause this behavior?


Railpromo

December 29, 2015 at 1:55 pm

Just a reply to enable the e-mail notification function.


Josh

  • Support Staff

December 29, 2015 at 2:37 pm

What happens is if the shortcode is being added through an options panel, like in the case of the Onetone homepage, then the shortcode’s necessary scripts and styles will not load.

One way to work around this is add something like this to your functions.php file:

function onetone_load_calendar_scripts_on_homepage() {
    if (is_front_page()){
        global $is_espresso_calendar;
        $is_espresso_calendar = TRUE;       
    }

}
add_action('wp_enqueue_scripts', 'onetone_load_calendar_scripts_on_homepage');

You can add the above to a functions plugin or into your WordPress theme’s functions.php file. We recommend using a child theme if you add to the functions.php file.


Railpromo

December 30, 2015 at 2:43 am

Dear Josh,

Thanks for your help. Problem solved using the child theme method!


Railpromo

December 30, 2015 at 3:12 am

Dear Josh,

Unfortunately, I still encounter a problem. In case I want to load a second instance of the calendar using the shortcode, it doesn’t load the 2nd instance.


Josh

  • Support Staff

December 30, 2015 at 8:56 am

Hi there,

It turns out the calendar shortcode has a limit where it can be used once on a page.


Railpromo

December 30, 2015 at 9:15 am

Dear Josh,

Thank you for pointing this out, however I was hoping for a solution of course
Is there anything to do about this? Although it might seem uncommon, it’s relevant to our website to be able to display the calendar twice.

Best,
Luc


Lorenzo Orlando Caum

  • Support Staff

December 30, 2015 at 12:12 pm

Hi Luc,

I tested a workaround that should get you close by using an iframe on the second events calendar. You can see the details here:

https://gist.github.com/lorenzocaum/26787b3aa628f801366a


Lorenzo

The support post ‘Calendar not showing on parallax home page, working fine on regular 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.

Event Espresso