Style.css in child theme is loaded before Bootstrap

Mostly the parent theme might be enqueing the child theme’s style.css, if so you can dequeue it by using handle and then enqueue with proper dependency. If the child theme’s handle is child-theme-style, then dequeue it using wp_dequeue_style(‘child-theme-style’) then enqueue it as needed like so. wp_enqueue_style(‘child-theme-dep’,get_stylesheet_uri(),array(‘bootstrap-handle-here’)) We can easily know the child theme stylesheet url … Read more

Add last modified time as version to css and js

You could use add_query_arg() but then you’d have to parse the uri everytime, I’d rather create a wrapper function for wp_enqueue_script/style: function my_enqueuer($my_handle, $relpath, $type=”script”, $my_deps=array()) { $uri = get_theme_file_uri($relpath); $vsn = filemtime(get_theme_file_path($relpath)); if($type == ‘script’) wp_enqueue_script($my_handle, $uri, $my_deps, $vsn); else if($type == ‘style’) wp_enqueue_style($my_handle, $uri, $my_deps, $vsn); } Add this in your functions file … Read more

How can I enqueue a style only when a particular widget is active?

You need to modify this a little bit. class Organiser extends WP_Widget { … function __construct() { add_action( ‘wp_enqueue_scripts’, array(‘Organiser’, ‘register_plugin_styles’) ); … } public function widget( $args, $instance ) { wp_enqueue_style( ‘organiserStyle’ ); include(dirname(__FILE__).”/organiserWidget.php”); } static function register_plugin_styles() { wp_register_style( ‘organiserStyle’, plugins_url( ‘organiser/css/organiserStyle.css’ ) ); // wp_register_style( ‘organiserStyle’, plugin_dir_url( __FILE__ ) . ‘css/organiserStyle.css’ ); … Read more

Disable child theme css on certain pages

There are two methods to accomplish what you what need to do. METHOD 1 The first method is to create a separate stylesheet from your child’s main style.css, and then move all your css into that stylesheets. For this example, lets call this stylesheet custom-style.css. As said, copy all the css that will be specific … Read more

Enqueued scripts and styles loading in WordPress Dashboard as well

The “init” action runs both on frontend page loads, and on backend page loads. Try hooking these to the “wp_enqueue_scripts” action instead. I believe it does not run on admin page loads. Example Code: (By OP) function wpse54388_scripts_styles() { wp_enqueue_style( … ); wp_enqueue_script( … ); } add_action( ‘wp_enqueue_scripts’, ‘wpse54388_scripts_styles’ );

To enqueue or not to enqueue

Method 2 You can enqueue all of your stylesheets form the same place even controlling where the stylesheets load by means of template conditionals, which is convenient and prevents a lot of mess in your <head>. You can remove enqueued stylesheets if you need to via a plugin, for example. Enqueued stylesheets are child theme … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)