home_url() 函數用來獲取 WordPress 的首頁鏈接。
用法
|
1 |
home_url($path,$scheme); |
參數
$path
(字符串)(可選) 在首頁鏈接後邊追加的內容,是相對鏈接。
默認值:None
$scheme
(字符串)(可選) 鏈接協議,只支持 「http」,「https」 和 「relative」 。
默認值:null
返回值
(字符串) 返回首頁 URL 加上 $path 參數。
例子
|
echohome_url();//輸出:http://www.example.com echohome_url('/');//輸出:http://www.example.com/ echohome_url('/','https');//輸出:https://www.example.com/ echohome_url('example','relative');//輸出:/example |
其它
此函數位於:wp-includes/link-template.php