Replies: 0
My custom theme enqueues JS and CSS in the header. I’m using the live Elementor editor on the front-end of a page. Only on a page that has the Elementor page builder activated will neither of these (script or style sheet) be called on those pages (or so it seems). On a page that does Not have Elementor activated, the JS and CSS are enqueued just fine.
I’ve tried viewing the page source with my browser’s command (Cmd + U in Firefox), and also inspected that page using Firebug. I cannot locate the JS or CSS files that are enqueued. What happens is that the preloader (which works on non-Elemetor pages) doesn’t disappear after a page has finished loading: JS function.
I’ve tried enqueuing the CSS and JS in the footer, then hard-refreshing (Shift + Cmd + R in Firefox) the page. That doesn’t help.
I’ve noticed that when looking at the Elementor live editor page’s source, that Elementor placed that page in an iframe
. Does this possibly have something to do with this?
A couple Elementor versions ago, an Elementor page would load and the preloader would disappear as intended. I just tested by reverting to older versions of Elementor. The preloader works in Elementor 0.8.1, and the next version Elementor 0.9.0, the preloader doesn’t work.
Any thoughts on how to fix this?
In case this comes in handy, here’s my enqueue script:
function enqueue_plugin_styles_scripts()
{
//wordpress.org enqueue STYLE example: wp_enqueue_style( $handle, $src, $deps, $ver, $media );
wp_enqueue_style( 'theme-style', plugin_dir_url(__FILE__) . 'css/frontend.css', false, '4.0', 'screen' );
wp_enqueue_style( 'font-awesome', plugin_dir_url(__FILE__) . 'css/font-awesome.min.css', '4.6.3', null );
//wordpress.org enqueue SCRIPT example: wp_enqueue_script( $handle, $src, $deps, $ver, $in_footer );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'theme-script', plugin_dir_url(__FILE__) . 'js/frontend.js', array('jquery'), '4.0', null );
}
add_action( 'wp_enqueue_scripts', 'enqueue_plugin_styles_scripts', 10 );
-
This topic was modified 12 minutes ago by
Adam.