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 链接
基础教程推荐
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何替换eregi() 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
