get_template_directory_uri()获取当前主题所在的绝对路径URL

目录

描述

译文

检索模板 目录URI

原文

Retrieve template directory URI for the current theme. Checks for SSL.

Note: Does not return a trailing slash following the directory address.

In the event that a child theme is being used, the parent theme directory URI will be returned. get_template_directory_uri() should be used for resources that are not intended to be included in/over-ridden by a child theme. Use get_stylesheet_directory_uri() to include resources that are intended to be included in/over-ridden by the child theme.

get_template_directory_uri() 描述

用法

Use the URI<?php get_template_directory_uri(); ?>

Output the URI<?php echo get_template_directory_uri(); ?>

get_template_directory_uri() 用法

参数

返回值

uri (string

Template directory URI.

get_template_directory_uri() 返回值

示例

Using get_template_directory_uri() to enqueue a script with the correct path

get_template_directory_uri() 示例

注意

get_template_directory_uri() 注意

历史

  • 添加于 版本: 1.5.0

get_template_directory_uri() 历史

源文件

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

get_template_directory_uri() 源文件

相关