home_url

函式
home_url ( $path = '', $scheme = null )
引數
  • (string) $path Optional. Path relative to the home URL. Default empty.
    Required:
    Default: (empty)
  • (string|null) $scheme Optional. Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null. Default null.
    Required:
    Default: null
返回值
  • (string) Home URL link with optional path appended.
定義位置
相關方法
get_home_urlnetwork_home_urlesc_urlsite_urlcontent_url
引入
3.0.0
棄用
-

home_url – 這是一個WordPress的函式,用於檢索網站主頁的URL。主頁是網站的主頁面,通常顯示最近的文章列表、靜態頁面或自定義佈局。home_url函式可以用來動態生成主頁的連結,或者在自定義位置顯示主頁的URL。

檢索當前網站的URL,該網站可以訪問前端。

返回帶有適當協議的’home’選項。如果is_ssl()評估為true,協議將是’https’;否則,將與’home’選項相同。如果`$scheme`是’http’或’https’,is_ssl()被覆蓋。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function home_url( $path = '', $scheme = null ) {
return get_home_url( null, $path, $scheme );
}
function home_url( $path = '', $scheme = null ) { return get_home_url( null, $path, $scheme ); }
function home_url( $path = '', $scheme = null ) {
	return get_home_url( null, $path, $scheme );
}

常見問題

FAQs
檢視更多 >