wp_enqueue_script() and wp_enqueue_style() offer various options for developers and its the best way to add style and scripts to WordPress.
$handle is simply the name of the stylesheet. $src is where it is located. The rest of the parameters are optional. $deps refers to whether or not this stylesheet is dependent on another stylesheet. If this is set, this stylesheet will not be loaded unless its dependent stylesheet is loaded first. $ver sets the version number. $media can specify which type of media to load this stylesheet in, such as ‘all’, ‘screen’, ‘print’ or ‘handheld.’
So if you wanted to load a stylesheet named “slider.css” in a folder named “CSS” in you theme’s root directory, you would use:
$handle is the name for the script. $src defines where the script is located. $deps is an array that can handle any script that your new script depends on, such as jQuery. $ver lets you list a version number. $in_footer is a boolean parameter (true/false) that allows you to place your scripts in the footer of your HTML document rather then in the header, so that it does not delay the loading of the DOM tree.
So if you wanted to load a script named “script.js” in a folder named “js” in your theme’s root directory, you would use:
Combining Enqueue Functions
It is best to combine all enqueued scripts and styles into a single function, and then call them using the wp_enqueue_scripts action.
At Coded With Pride, we specialize in different Services like Website Development, Software Development, Mobile Applications, Digital Marketing, SEO (Search Engine Optimization), Facebook API, Youtube and lots more to go. Our expert team strives to bestow best in WordPress theme development. Not only in this but we have experience of many years in Responsive theming and Bootstrap.