How to enqueue the style using wp_enqueue_style()

This is what you could do: 1 – Put the CSS in a separate file and save it in your theme directory. 2 – Add the following code in your functions php: function wpse_89494_enqueue_scripts() { if ( has_nav_menu( ‘secondary’ ) ) { wp_enqueue_style( ‘wpse_89494_style_1’, get_template_directory_uri() . ‘/your-style_1.css’ ); } if ( has_nav_menu( ‘primary’ ) ) … Read more

Why is style.css not being enqueued?

Theme stylesheets aren’t usually enqueued, they’re normally loaded using.. <link rel=”stylesheet” type=”text/css” media=”all” href=”https://wordpress.stackexchange.com/questions/14655/<?php bloginfo(“stylesheet_url’ ); ?>” /> So naturally you don’t see them(it) in the styles array.. You can of course(if you prefer) use an enqueue instead.

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

Enqueue Google Web Fonts Without Messing Up Symbols In URL

WordPress knows what it is doing here. Honest. When rendering an ampersand in HTML, you should always use &amp; or &#038;. The browser then converts it to & before actually firing the HTTP request. See for yourself by inspecting the network calls in a web inspector tool. You’re not actually losing your non-latin subsets. Notice … 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