【发布时间】:2014-10-24 18:26:11
【问题描述】:
它可能会像往常一样愚蠢,但是.. 我无法让我的 style.css 或 custom.css 覆盖引导 css。我不想把我所有的自定义 css 放在我的头文件中,因为我想这不是真正的方法..
现在我尝试像这样将它添加到我的functions.php中:
//Enqueue scripts and styles
function horizon_scripts() {
//Load the theme CSS
wp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/bootstrap/css/bootstrap.min.css');
wp_enqueue_style( 'main', get_template_directory_uri() . '/style.css');
// Register the script like this for a theme:
wp_register_script( 'custom-script', get_template_directory_uri() . '/bootstrap/js/bootstrap.js', array( 'jquery' ) );
wp_register_script( 'custom-script', get_template_directory_uri() . '/bootstrap/js/bootstrap.min.js', array( 'jquery' ) );
wp_register_script( 'custom-script', get_template_directory_uri() . '/bootstrap/css/custom.css', array(), '1.0.1', 'all' );
// For either a plugin or a theme, you can then enqueue the script:
wp_enqueue_script( 'custom-script' );
}
add_action( 'wp_enqueue_scripts', 'horizon_scripts' );
所以它先加载我的引导 css,然后加载 style.css 和 custom.css,但这并没有完全成功..
所以任何帮助将不胜感激:)
【问题讨论】:
-
刚试了,还是不行
标签: php html css wordpress twitter-bootstrap