How to link multiple CSS files with WordPress(如何将多个 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 链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何将多个 CSS 文件与 WordPress 链接
基础教程推荐
- 在 CakePHP 2.0 中使用 Html Helper 时未定义的变量 2021-01-01
- HTTP 与 FTP 上传 2021-01-01
- 找不到类“AppHttpControllersDB",我也无法使用新模型 2022-01-01
- 在 yii2 中迁移时出现异常“找不到驱动程序" 2022-01-01
- 如何在 Symfony 和 Doctrine 中实现多对多和一对多? 2022-01-01
- PHP 守护进程/worker 环境 2022-01-01
- 如何在 XAMPP 上启用 mysqli? 2021-01-01
- phpmyadmin 错误“#1062 - 密钥 1 的重复条目‘1’" 2022-01-01
- 使用 PDO 转义列名 2021-01-01
- Doctrine 2 - 在多对多关系中记录更改 2022-01-01