style.css在wordpress中不起作用 [英] style.css not working in wordpress

查看:73
本文介绍了style.css在wordpress中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Wordpress上遇到问题,我创建了所有必需的文件,包括style.css index.php等,但是页面未设置样式.在标题中,除其他外,我已将其

I have a problem with Wordpress, I've created all needed files including style.css index.php and so on but the page is not styled. In header, among other things, I've put this

<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/bootstrap.css" />
<link rel="stylesheet" type="text/css" href="<?php bloginfo('template_url'); ?>/css/bootstrap-responsive.css" />
<link rel="stylesheet" type="text/css" href="text/css" href="<?php bloginfo('template_url'); ?>/css/style.css" />

推荐答案

添加除style.css之外的样式表,打开function.php并添加以下代码.

Add stylesheet other than style.css, open function.php and add the following code.

add_action( 'wp_enqueue_scripts', 'theme_name_scripts' );
function theme_name_scripts() {
   wp_enqueue_style( 'style-name', get_stylesheet_uri() . "/css/bootstrap.css" );
   wp_enqueue_style( 'style-name', get_stylesheet_uri() . "/css/bootstrap-responsive.css" );
}

使用Thins添加style.css文件:

Add the style.css file using thins:

<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">

这篇关于style.css在wordpress中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆