Inbuilt style for jquery-ui-datepicker

As far as I know, there is not style for datepicker. You have to register your own. The code then will be: function rr_scripts() { wp_enqueue_script( ‘jquery’ ); wp_enqueue_script( ‘jquery-ui-datepicker’, array( ‘jquery’ ) ); wp_register_style( ‘bootstrap_css’, get_template_directory_uri() . ‘/assets/css/bootstrap.min.css’ ); wp_enqueue_style( ‘bootstrap_css’ ); // I’m using Twitter Bootstrap as CSS(if it matters) wp_register_style(‘jquery-ui’, ‘http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css’); wp_enqueue_style( … Read more

How to load Widget javascript + css files only if used?

wp_print_scripts and wp_print_styles hooks are fired way before your widget function so that is way it’s not working. A solution to that would be to include the scripts in the footer using wp_print_footer_scripts hook, take a look at Jan’s answer to a similar question Or a much nicer solution take a look at Sorich’s answer … Read more

Remove Open Sans from Twenty Twelve theme

Found the answer here: Script dequeuing calls should be added to the wp_print_scripts action hook(..). This is because scripts are typically enqueued on the wp_enqueue_script hook, which happens early in the wp_head process. The wp_print_scripts hook happens right before scripts are printed, and thus is latest in the process. (Otto) Following the same logic we … Read more

Prevent Version URL Parameter (?ver=X.X.X) on Enqueued Styles & Scripts

Default wp_enqueue_[style/script]() behavior The default value for the $version argument of wp_enqueue_style() is false. However, that default just means that the stylesheets are given the WordPress version instead. Solution Thanks to “Remove version from WordPress enqueued CSS and JS”, I learned the undocumented fact that passing in null as a version will remove the version … Read more

Load CSS/Javascript in frontend conditionally if block is used

Well, the styles and scripts you register in your php register_block_type call should only be loaded when the block is in use if i recall correctly. If you want to load additional scripts or styles to be enqueued only if there is a block of type “my-awesome/block-type”, you can use the has_block function in your … Read more

Style custom columns in admin panels (especially to adjust column cell widths)

I found a solution that works for me! I dropped this code in functions.php : add_action(‘admin_head’, ‘my_column_width’); function my_column_width() { echo ‘<style type=”text/css”>’; echo ‘.column-mycolumn { text-align: center; width:60px !important; overflow:hidden }’; echo ‘</style>’; }

How to add crossorigin and integrity to wp_register_style? (Font Awesome 5)

style_loader_tag style_loader_tag is an official WordPress API, see the documentation: https://developer.wordpress.org/reference/hooks/style_loader_tag/ apply_filters( ‘style_loader_tag’, $html, $handle, $href, $media )Filters the HTML link tag of an enqueued style. First enqueue your stylesheet, see documentation: https://developer.wordpress.org/reference/functions/wp_enqueue_style/ wp_enqueue_style( ‘font-awesome-5’, ‘https://use.fontawesome.com/releases/v5.5.0/css/all.css’, array(), null ); The $handle is ‘font-awesome-5’ I do null so that there is no version number. This way … Read more

How can I get a list of all enqueued scripts and styles?

do_action doesn’t quite work like that. When you call do_action(‘crunchify_print_scripts_styles’) WP looks at its list of registered actions and filters for any that are attached to a hook called crunchify_print_scripts_styles and then runs those functions. And you probably want to remove this: add_action( ‘wp_enqueue_scripts’, ‘crunchify_print_scripts_styles’); … because you aren’t able to get the return result … Read more