欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

簡介WordPress中用于獲取首頁和站點(diǎn)鏈接的PHP函數(shù)

 更新時(shí)間:2015年12月17日 16:14:57   作者:斌果  
這篇文章主要介紹了WordPress中用于獲取首頁和站點(diǎn)鏈接的PHP函數(shù),分別是home_url()和site_url()需要的朋友可以參考下

home_url()(獲取首頁鏈接)
ome_url() 函數(shù)用來獲取 WordPress 的首頁鏈接。

用法

home_url( $path, $scheme );

參數(shù)

$path

(字符串)(可選)在首頁鏈接后邊追加的內(nèi)容,是相對(duì)鏈接。

默認(rèn)值:None

$scheme

(字符串)(可選)鏈接協(xié)議,只支持 “http”,“https” 和 “relative”。

默認(rèn)值:null

返回值

(字符串)返回首頁 URL 加上 $path 參數(shù)。

例子

echo home_url();//輸出:http://www.example.com
echo home_url( '/' );//輸出:http://www.example.com/
echo home_url( '/', 'https' );//輸出:https://www.example.com/
echo home_url( 'example', 'relative' );//輸出:/example

其它
此函數(shù)位于:wp-includes/link-template.php


site_url()(獲取站點(diǎn)鏈接)
site_url() 函數(shù)用來獲取 WordPress 的站點(diǎn)鏈接。

用法

site_url( $path, $scheme );

參數(shù)

$path

(字符串)(可選)在鏈接后追加的內(nèi)容。

默認(rèn)值:None

$scheme

(字符串)(可選)鏈接協(xié)議,只允許 “http”、“https”、“l(fā)ogin”、“admin” 和 “relative”。

默認(rèn)值:null

返回值

(字符串)返回站點(diǎn)鏈接加上 $path 參數(shù)。

例子

echo site_url();//輸出:http://www.example.com 或者 http://www.example.com/wordpress
echo site_url( '/secrets/', 'https' );//輸出:https://www.example.com/secrets/ 或者 https://www.example.com/wordpress/secrets/

其它

此函數(shù)位于:wp-includes/link-template.php


相關(guān)文章

最新評(píng)論