How to Link Stylesheet in Twenty Sixteen Theme |August 25, 2016
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
wp_enqueue_style( ‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap/bootstrap.min.css’);
// Theme stylesheet.
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);