Support

Home Forums Event Espresso Premium Calendar on Events Archive

Calendar on Events Archive

Posted: September 22, 2021 at 10:31 am


rbschool

September 22, 2021 at 10:31 am

Is it possible to display the calendar on the event archive page above the loop? I’ve tried [ESPRESSO_CALENDAR] and ?php echo do_shortcode(‘[ESPRESSO_CALENDAR]’); ?> both and neither work on the archive page.


Tony

  • Support Staff

September 22, 2021 at 2:15 pm

Hi there,

When you use the shortcode directly within the template file, EE can’t detect the usage of the shortcode within the content (it checks for EE shortcode usage so we only add our assets when they are actually needed) so you need to add a snippet of code to tell EE to loads the Calendar scripts.

Here’s an example:

https://gist.github.com/joshfeck/e2a4bae79dbf89d56b03b8895ddeeef1

You can add that to a custom functions plugin on your site, we have some documentation on creating one here:

https://eventespresso.com/wiki/create-site-specific-plugin-wordpress-site/

Then change the is_front_page() function to is_post_type_archive(‘espresso_events’) which should load the assets on that output.

The support post ‘Calendar on Events Archive’ 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