WordPress has a lots of dynamically generating URL code. Sometime moving your wordpress from localhost to online server you might face a lots of URL editing manually. To overcome this issue we can use the default wordpress home page directory, that holds the URL of wordpress home page directory.
WordPress home page directory php code
$url = home_url(); echo $url;
It will generate the your website home page URL