Home_url () (Get home link)
The Ome_url () function is used to get the homepage link of WordPress.
Usage
Home_url ($path, $scheme);
Parameters
$path
(string) (optional) The appended content behind the homepage link is a relative link.
Default value: None
$scheme
(string) (optional) Link protocol, which only supports "http", "https", and "relative".
Default value: null
return value
(string) Returns the first page URL plus $path parameter.
Example
Echo Home_url ();//output: Http://www.example.comecho home_url ('/');//output: Http://www.example.com/echo home_url ('/', ' HTTPS ');//output: Https://www.example.com/echo home_url (' example ', ' relative ');//output:/example
Other
This function is located at: wp-includes/link-template.php
Site_url () (Get site link)
The Site_url () function is used to get the site link for WordPress.
Usage
Site_url ($path, $scheme);
Parameters
$path
(string) (optional) the content appended after the link.
Default value: None
$scheme
(string) (optional) Link protocol, which only allows "http", "https", "Login", "admin" and "relative".
Default value: null
return value
(string) returns the site link plus $path parameter.
Example
echo Site_url ();//output: http://www.example.com or Http://www.example.com/wordpressecho site_url ('/secrets/', ' https ') ;//output: https://www.example.com/secrets/or https://www.example.com/wordpress/secrets/
Other
This function is located at: wp-includes/link-template.php
The above describes the introduction of WordPress to get home page and site link PHP function, including the content of the contents, I hope that the PHP tutorial interested in a friend helpful.