I'm making a custom wordpress theme, but for some reason the enqueue style is not working.
I've added:
<?php get_header(); ?>
to the index.php
And i've added
<?php wp_head();?>
Inside the head tag.
The following code is inside my functions.php:
function pompier_scripts() {
wp_enqueue_style( 'main-style', get_stylesheet_uri() );
wp_enqueue_style( 'bootstrap-style', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '1.0.0', false );
//wp_enqueue_script( 'bootstrap-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '1.0.0', false );
}
add_action( 'wp_enqueue_scripts', 'pompier_scripts' );
What am i missing here?
我不知道这是否有帮助,但是我只是创建了我的第一个子主题,并且由于它基于父主题,因此必须像这样排入我的自定义样式表,才能使其工作:
wp_enqueue_style( 'my-style', get_stylesheet_uri() . '/style.css' );
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.