network_site_url()返回站点网址(多站点)

目录

描述

The network_site_url template tag retrieves the site url for the "main" site of the current network with the appropriate protocol, 'https' if is_ssl() and 'http' otherwise. If scheme is 'http' or 'https', is_ssl() is overridden.

If the site is not setup as multisite, site_url() will be used instead.

network_site_url() 描述

用法

<?php network_site_url$path$scheme ); ?>

Default Usage

<?php echo network_site_url(); ?>

network_site_url() 用法

参数

$path

(string) (可选) Path to be appended to the site url.

默认值: None

$scheme

(string) (可选) Context for the protocol for the url returned. Setting $scheme will override the default context. Allowed values are 'http', 'https', 'login', 'login_post', or 'admin'.

默认值: null

network_site_url() 参数

示例

Output: http://www.example.com/wordpress/

Output: https://www.example.com/contact-us/

network_site_url() 示例

注意

network_site_url() 注意

相关