如何将多个 CSS 文件与 WordPress 链接 [英] How to link multiple CSS files with WordPress

查看:21
本文介绍了如何将多个 CSS 文件与 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 hemes wentyelevencss 中.然后您可以通过以下方式链接所有这些简单地把下面的代码-

Just put all of your stylesheets in a directory wp-content hemes wentyelevencss.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" />

享受编码.

这篇关于如何将多个 CSS 文件与 WordPress 链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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