get_stylesheet_directory_uri()获取当前主题样式表style.css所在的网址目录

目录

描述

译文

检索样式表单目录URI

原文

Retrieve stylesheet directory URI for the current theme/child theme. Checks for SSL.

Note: Does not contain a trailing slash.

Note that this returns a properly-formed URI; in other words, it will be a web-address (starting with http:// or https:// for SSL). As such, it is most appropriately used for links, referencing additional stylesheets, or probably most commonly, images.

In the event a child theme is being used, this function will return the child's theme directory URI.
Use get_template_directory_uri() to avoid being overridden by a child theme.

If you want to include a local file in PHP, use get_stylesheet_directory() instead.

get_stylesheet_directory_uri() 描述

用法

Use the URI<?php get_stylesheet_directory_uri(); ?>Output the URI<?php echo get_stylesheet_directory_uri(); ?>

get_stylesheet_directory_uri() 用法

参数

返回值

uri (string

Stylesheet directory URI.

get_stylesheet_directory_uri() 返回值

示例

Image (HTML)

get_stylesheet_directory_uri() 示例

注意

get_stylesheet_directory_uri() 注意

历史

  • 添加于 版本: 1.5.0

get_stylesheet_directory_uri() 历史

源文件

get_stylesheet_directory_uri() 函数的代码位于 wp-includes/theme.php.

get_stylesheet_directory_uri() 源文件

相关