WordPress at a glance

home_url() WP 1.0

Retrieves the URL for the current site where the front end is accessible.

Returns the 'home' option with the appropriate protocol. The protocol will be 'https' if is_ssl() evaluates to true; otherwise, it will be the same as the 'home' option. If $scheme is 'http' or 'https', is_ssl() is overridden.


String. Home URL link with optional path appended.

Works based on: get_home_url()
1 time = 0.000047s = very fast | 50000 times = 0.51s = very fast | PHP 7.1.2, WP 4.7.3

No Hooks.


home_url( $path, $scheme );
Path relative to the home URL.
Default: ''
Scheme to give the home URL context. Accepts 'http', 'https', 'relative', 'rest', or null.
Default: null

Список изменений

С версии 3.0.0 Введена.

Code of home_url() WP 5.5.1

function home_url( $path = '', $scheme = null ) {
	return get_home_url( null, $path, $scheme );

Related Functions

From tag: Link (URL)

More from category: Site Options (settings)

More from Template Tags: Links (URL)

No comments
    Log In . Register