Posts

Showing posts from September, 2015

How to Enqueue Styles and Script in WordPress

Enqueue Styles in WordPress This function provides a systematic way of loading Stylesheets. By using wp_enqueue_script function, you tell WordPress when to load a stylesheets, where to load it, and what are it’s dependencies. Usage of Enqueue Script Funtion Loading the scripts properly in WordPress is very easy. Below is the code that you would paste in your plugins file or in your theme’s functions.php file to properly load scripts in WordPress. <?php wp_enqueue_style (  $handle ,  $src ,  $deps ,  $ver ,  $media  );  ?> Explanation: This function accepts 5 parameters: $handle – Handle is the unique name of your stylesheet ( Its a required string parameter ). Default : None $src – src is the location of your stylesheet ( Its an optional string/boolean parameter ). Default : false $deps – deps is for dependency ( Its an optional array parameter ). Default : array() $ver – This is the version number of your ...

How to Enqueue Styles Automatically

Enqueue Styles in WordPress This function provides a systematic way of loading Stylesheets. By using wp_enqueue_script function, you tell WordPress when to load a stylesheets, where to load it, and what are it’s dependencies. Usage of Enqueue Script Funtion Loading the scripts properly in WordPress is very easy. Below is the code that you would paste in your plugins file or in your theme’s functions.php file to properly load scripts in WordPress. <?php wp_enqueue_style (  $handle ,  $src ,  $deps ,  $ver ,  $media  );  ?> Explanation: This function accepts 5 parameters: $handle – Handle is the unique name of your stylesheet ( Its a required string parameter ). Default : None $src – src is the location of your stylesheet ( Its an optional string/boolean parameter ). Default : false $deps – deps is for dependency ( Its an optional array parameter ). Default : array() $ver – This is the version number of your ...