Enqueue script/style with multiple GET parameters

esc_url is run on the stylesheet URL and that converts those characters. You can work around it with a couple of filters. function style_params($src, $handle) { if (‘twentyfourteen-style’ == $handle) { add_filter(‘clean_url’,’alter_clean_url’,10,3); } return $src; } add_filter(‘style_loader_src’,’style_params’,10,2); function alter_clean_url($good_protocol_url, $original_url, $_context ) { remove_filter(‘clean_url’,’alter_clean_url’,10,3); $good_protocol_url = html_entity_decode($good_protocol_url); $good_protocol_url = $good_protocol_url.’&abc=def’; return $good_protocol_url; }

How do I get shortcode, widget and template tag CSS to load in the head only as required? [duplicate]

Neither wp_enqueue_style() nor wp_register_style() have a parameter to allow them to be loaded in the head, rather than the footer, as their script counterparts do. The only solution is to have some of your CSS (or all of it – which would be bad) inside a style tag inside head, added with the wp_head action … Read more

How to output wp_enqueue_style() in HTML head instead of footer

hook into init action on your initial plugin function add_action(‘init’, array(__CLASS__, ‘your_function_within_class’)); and add the function public static function your_function_within_class() { wp_register_style(‘myfirstplugin-admin-css’, ‘/wp-content/plugins/myfirstplugin/assets/style.css’, false); wp_enqueue_style(‘myfirstplugin-admin-css’); } hope this help

Custom admin bar css on front end bug

You make it the wrong way. First, you do double work. Enqueue inside enqueue. You don’t need wp_enqueue_scripts(): wp_enqueue_style( ‘color-admin-bar’, PATH_TO_CSS, array( ‘admin-bar’ ) ); Second. Don’t use anonymous functions with WordPress Actions. Once-for-all-time is OK, but while the project is growing up you can collide with the inability to dequeue that style when you’ll … Read more

Should I use `get_stylesheet_uri()` or `get_template_directory_uri()` when calling my CSS Stylesheet?

WordPress recommends the proper way to enqueue the main style is the method-A. Please see the WordPress theme development handbook here (though both methods will work). https://developer.wordpress.org/themes/basics/including-css-javascript/ It’s not clear to me why you want to link the two .css file? You can create custom .css file and enqueue it using method-B. However, if you … Read more