jquery script not enqueued in child theme
I need a little bit of insight here with the following problem? I’ve created a child theme called ‘test_child’ which I am trying to extend in the following way:
I need a little bit of insight here with the following problem? I’ve created a child theme called ‘test_child’ which I am trying to extend in the following way:
Assuming I have no infinite scroll or anything else going on in my theme:
Is there a way to enqueue my custom Gutenberg block styles and scripts so they are only (lazy) loaded in the front-end when the block is really used? Something like is_active_widget, just for blocks?
I’m working on a script to easily move js and css scripts to the footer using the add_data function in $wp_scripts and $wp_styles. I know for scripts that if the group is greater than 0 the script call will be moved to the footer (first foreach below does that). However, setting the group for styles doesn’t have the same effect (and group is set properly with second foreach). Is there a way to move styles to the footer with the same method, or should I be looking for an alternative?
Is there some way to get the $handle for each script that has been enqueued?
I created a widget that uses a jquery plugin, and I used is_active_widget to enqueue the script, it’s working fine but it’s also including the script even on pages that doesn’t show this widget.
so is there a way to only enqueue the script if this widget is showing ?
How can I get all enqueued styles or scripts and then deregister them all at once?
WP has a nice javascript loader included in wp-admin:
http://core.trac.wordpress.org/browser/tags/3.0.4/wp-admin/load-scripts.php
I’m running a function on pages where the shortcode [make-me-a-map] is used. It enqueues javascript to the page and makes a map. That part works fine (woot!) but I’m having trouble with adding the stylesheets to only those pages in a similar fashion.
I was trying to move the load of my style.css in the footer of my wordpress theme. I have already done something similar with 2 js files and it works fine, they load in the footer: function my_init() { if (!is_admin()) { wp_deregister_script('jquery'); wp_register_script('jquery', 'http://www.studionews24.com/wp-content/themes/network/js/jquery.min.js', false, '1.3.2', true); wp_enqueue_script('jquery'); // load a JS file from … Read more