wordpress url homepage code example
Example: home url wordpress
$url = home_url();
echo $url; // Output: http://www.example.com
$url = home_url( '/' );
echo $url; // Output: http://www.example.com/
$url = home_url( $path = '/', $scheme = 'https' );
echo $url; // Output: https://www.example.com/
$url = home_url( $path = 'example', $scheme = 'relative' );
echo $url; // Output: /example