Posted: August 7, 2015 at 10:18 am
|
I have the same problem as this guy: https://eventespresso.com/topic/ee4-calendar-shortcode-acfdo_shortcode/ The javascript shows up, div shows up, but the calendar is empty. I’m able to run this shortcode normally through another template and the calendar shows up beautifully. But here it shows up with just the controls. |
Hi Taryn, Are you calling the calendar shortcode from a do_shortcode() function, if so, there’s a few things you’ll need to do to make sure the calendar’s resources are loaded, and there’s some code that you can use that’s outlined our documentation: https://eventespresso.com/wiki/events-calendar-add-on/#ee4customizations |
|
|
I saw that information about enqueuing scripts/styles. It’s not clear if this needs to happen before wp_header() is called, or if I can do it at the same time as calling do_shortcode(), and it’ll show in the footer. Anyway that’s a red herring. The calendar itself is the issue – it’s empty so there’s nothing to style or script. |
Hi Taryn, I wasn’t intending to mislead you, I’m sorry if it came across that way. If you can provide some more information about how you have the ACF shortcode set up with the page template and field, we can look into this. |
|
|
I wasn’t saying you were misleading me. I meant the scripts/styles issue is misleading, it’s not the problem. Basically we’re using Advanced Custom Fields flexible content fields: Basically we use get_row_layout() to find out what the layout is named. Then we php include a template file based on what the layout is. So in this case we have a layout named ‘calendar’ so we load a calendar.php file. Within the calendar.php file, we don’t use any fields except a title. Then we run echo do_shortcode(‘[ESPRESSO_CALENDAR]’); This is the output in HTML – notice there’s no actual calendar output. On another page not using advanced custom fields it renders fine:
|
Can you post the contents of calendar.php in a gist and link to it here? |
|
|
Here’s the gist: |
This does appear to be an issue with not loading the calendar scripts. It’s important to know that if the fullcalender.js script does not load on the page, no calendar HTML will be output. Can you try adding this code to the top of the page template that does the check for get_row_layout()?
If the above does not work, you can send a copy of the theme to support at thisdomain.com and we can investigate further. |
|
The support post ‘[espresso_events] shortcode doesn't work within Advanced Custom Fields’ 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.