【发布时间】:2015-11-04 10:32:41
【问题描述】:
我正在制作一个自定义 wordpress 主题,但由于某种原因,入队样式不起作用。
我已添加:
<?php get_header(); ?>
到 index.php
我已经添加了
<?php wp_head();?>
在里面 头标签。
以下代码在我的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' );
我在这里错过了什么?
【问题讨论】:
-
代码是正确的,我的意思是你没有犯常见的错误。但首先检查视图源是否添加了 css 标签。如果没有检查您的文件是否在正确的位置。在所有这些之前,请确保 get_header() 正在加载您放置 wp_head() 的所需文件
-
首先您必须检查您的样式表是否已附加...您可以通过查看源来检查...
标签: php wordpress function hyperlink