如何使用WordPress链接多个CSS文件 [英] How to link multiple CSS files with WordPress
问题描述
我知道要链接你使用的WordPress主 style.css
文件:
I know that to link your WordPress main style.css
file you use:
<link href="<?php bloginfo('stylesheet_url');?>"rel="stylesheet" type="text/css"/>
但是我有很多CSS文件需要链接到主PHP文件滑块,图片框等......
However I have quite a few CSS files that need to be linked to the main PHP file for things like sliders, picture boxes etc...
我不太清楚我会怎么做,因为<?php bloginfo('stylesheet_url ');?>
仅适用于名为 styles.css
的样式表,而我的其他样式表都有不同的名称。
I'm not quite sure how I would do that because the <?php bloginfo('stylesheet_url');?>
only works for the stylesheet that is named styles.css
and my other stylesheets all have different names.
有谁知道我怎么能把它们全部写进来?
Does anyone know how I can ink them all in?
推荐答案
目录中的样式表 wp-content \themes \twentyeleven\css
。然后,您可以通过简单地将下面的代码链接到所有这些 -
Just put all of your stylesheets in a directory wp-content\themes\twentyeleven\css
.Then you can link all these by simply put below code-
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style1.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style2.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style3.css" />
<link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri(); ?>/css/style4.css" />
享受编码。
这篇关于如何使用WordPress链接多个CSS文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!