Blog for web designers

WordPress home page directory

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
For eg:


http://localhost/your-site/
http://www.your-site.com/

Santosh Shah

My name is Santosh Shah and blogs at santosh-shah.com


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.