I am trying to add a simple CiviCRM profile shortcode to a template of my theme, but the required CiviCRM files are not being loaded in the wp_head and therefore the shortcode does not render the profile form.
I have traced the issue to CiviCRM only loading these files if the shortcodes are being added to the content of the page or post.
This means that not only does the do_shortcode function not render CiviCRM shortcodes, but also any ACF (Advanced Custom Fields) fields created cannot render the shortcode either.
The php function that handles all of this, is the 'prerender' function in the CiviCRM_For_WordPress_Shortcodes class of civicrm.shortcodes.php.
The shortcode I'm trying to add is as follows...
do_shortcode('[civicrm component="profile" gid="14" mode="create" hijack="0"]')
Does anyone know if this behaviour can be modified, so that the files are enqueued on all WP pages?
Thanks for any help!