If you only import style.css, I can put this on the top of the head
<link rel="stylesheet" href="<?php%20echo%20get_stylesheet_uri();%20?>" type="text/css" media="screen" /> If you add other styles, then add another one on the top of the head
<link rel="stylesheet" href="<?php%20echo%20get_template_directory_uri();?>/bootstrap.min.css">
Another recommended method:
Add the following method to functions.php
Copy code
/**
* Load front-end scripts and style sheets
* Load the main style sheet style.css
*/
add_action(‘wp_enqueue_scripts’, ‘my_scripts’);
function my_scripts() {
//Load style.css in the theme
wp_enqueue_style(‘global’, get_stylesheet_uri());
//Load the xx.css style in the css folder
wp_enqueue_style(‘index-style’, get_template_directory_uri().’/css/xx.css’);
//Similarly, load xx.js in the js folder
wp_enqueue_script(‘index-js’, get_template_directory_uri().’/js/xx.js’);
//Load the default jquery library before loading tool.js
wp_enqueue_script(‘lingfeng-lazy’,get_template_directory_uri().’/js/tool.js’,array(‘jquery’));
}
Copy code
Then add this in the head to automatically import the style~
<?php wp_head();?>
Comments (0)