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

Stooping a css file from loading in the header

Extract the ninja form plugin’s files to a folder, and use a text editor such as Notepad++ to search within the files of the plugin and find either one of these phrases: `wp_enqueue_style` OR `css_ninja_form` You will end up with at least 1 result, which will be similar to : add_action( ‘wp_enqueue_scripts’, ‘css_ninja_form’, xyz ); … Read more

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

How to NOT override inline css rules

Please see this post about including styles and scripts correctly. As far as I can see, you are just throwing in the style.css, giving WordPress not the opportunity to decide, which stylesheet comes when. In order to do that, you need to register your style first, then WordPress can decide according to your priority, where … Read more

PHP Notice: wp_enqueue_script was called incorrectly. Scripts and styles should not be registered

Before you can use, those two lines : wp_enqueue_style( ‘wp-auth-check’ ); wp_enqueue_script( ‘wp-auth-check’ ); you should register those assets, inside wp_enqueue_scripts or admin_enqueue_scripts, like the following : function my_assets() { wp_register_style( ‘wp-auth-check’, ‘path/to/style’, $deps = array, $ver = false, $media=”all” ) wp_register_script( ‘wp-auth-check’, ‘path/to/your-script’, $deps = array, $ver = false, $in_footer = false ) } … Read more

Bootstrap 4 Optimization

You just make a big mistake. use this guideline. header.php <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css” integrity=”sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm” crossorigin=”anonymous”> You also made a mistake calling js file. Frist needs jQuery then popper.js then bootstrap and the big mistake is you call all of them in the header file, that’s why when the page is loaded it takes time to … Read more

Browser stacks different versions of style.css

The problem comes from that the parent style is loaded twice : one with version (‘?ver=1.0 etc, first on your picture and loaded by your parent theme with versionning on wp_enqueue_style ), another without (the second on your picture, called by your function php). To solve this : remove wp_enqueue_style( $parent_style, get_template_directory_uri() . ‘/style.css’ ); … Read more

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