WordPress函数文档content_url()

返回实际的wp-content目录 描述 The content_url template tag retri…

返回实际的wp-content目录

描述

The content_url template tag retrieves the url to the content area for the current site with the appropriate protocol, ‘https’ if is_ssl() and ‘http’ otherwise.

用法

<?php content_url$path ); ?>

Default Usage

<?php $url content_url(); ?>

参数

$path

(string) (可选) Path relative to the content url.

默认值: None

示例

Output: http://www.example.com/wp-content (without end /)

注意

  • 使用到 WP_CONTENT_URL;

相关

WordPress Directories:
home_url() Home URL http://www.example.com
site_url() Site directory URL http://www.example.com or http://www.example.com/wordpress
admin_url() Admin directory URL http://www.example.com/wp-admin
includes_url() Includes directory URL http://www.example.com/wp-includes
content_url() Content directory URL http://www.example.com/wp-content
plugins_url() Plugins directory URL http://www.example.com/wp-content/plugins
theme_url() Themes directory URL (#18302) http://www.example.com/wp-content/themes
wp_upload_dir() Upload directory URL (returns an array) http://www.example.com/wp-content/uploads
  • 原文:http://codex.wordpress.org/Function_Reference/content_url
类别:WordPress函数文档

本文收集自互联网,转载请注明来源。
如有侵权,请联系 wper_net@163.com 删除。

评论 (0)COMMENT