Image Image Image Image Image Image Image Image Image Image

Best Tech Reviews | July 26, 2017

Scroll to top

Top

No Comments

How to Link Stylesheet in Twenty Sixteen Theme |

Haroon Aejaz
How to Link Stylesheet in Twenty Sixteen Theme

As we know that Themeforest has changed there Approval guideline of WordPress theme approval. so that why there are a couple of changes you need to do in your WordPress them. According to them it is important that theme and plugins load scripts and stylesheets using the standard WordPress method

Previously we were adding script or CSS in the footer if the theme. now it’s not the same anymore. today we are going to tell you the standard method of adding script or CSS to your latest theme.

Now WordPress use its built-in feature “wp_enqueue_style” for CSS. “wp_enqueue_style” required two parameters from you
1)name of that CSS file
2) Path of CSS file

Example:

wp_enqueue_style( ‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap/bootstrap.min.css’);
// Theme stylesheet.

Example:2
wp_enqueue_style( ‘style’, get_stylesheet_uri() );

you need to call this function in your theme functions.php

Now the same case with Script. if you need to add any JS or Script here is the method.

wp_enqueue_script( ‘script’, get_template_directory_uri() . ‘/js/script.js’, array ( ‘jquery’ ), 1.1, true);

css

(35)

Submit a Comment

Time limit is exhausted. Please reload the CAPTCHA.