gisraka.blogg.se

Wp enqueue
Wp enqueue










By default, It assigns the currently installed WordPress version number with a stylesheet if nothing has passed.

wp enqueue

$ver – This set the version number for your stylesheet.If you want to load your stylesheet after one or more CSS files then you can pass these stylesheet’s names within an array to set dependency for these files.

wp enqueue

So this parameter holds the dependency for the current stylesheet. $dep – This refers to an array of the registered stylesheet or CSS files on which the current stylesheet or CSS file depends on.$src – As can be understood by its name, It refers to the source of the stylesheet or complete path to the stylesheet or CSS file.Basically this is used to identify your stylesheet. It could be different from your actual stylesheet name but it should be Unique. This refers to the name of your stylesheet or CSS file. $handle – First of all its a Required Parameter and second is it accepts ‘string’ type value.This function first registers the stylesheet or CSS file and then includes it within your WordPress theme or plugin.Īnother important thing to keep in mind about the wp_enqueue_function() function is, it accepts a few parameters, and it’s important to understand them to use this function most out of it. Wp_enqueue_style() – The function, which allows you to include stylesheet or CSS files in WordPress. But before that, let’s understand the function wp_enqueue_style() behind enqueuing CSS and fonts in WordPress.

wp enqueue

Including CSS files or fonts in the header can cause conflicts with other CSS files.įurther in this article, You will see enqueuing CSS, fonts, and external stylesheet and much more. However, you can include CSS file or fonts in the header file or in the head section of your WordPress website but this is not best practice at all. If you are a newbie in WordPress development then enqueuing stylesheet, font-awesome icons, Google fonts, External stylesheet and enqueuing Javascript and Jquery in WordPress is something that you should take extra care.












Wp enqueue