This example shows you how to get base URL of your wordpress powered website. It takes the value from your site information which can be modified and was set during the installation of WordPress.
Source code viewer
/* * Get wordpress base url. * * What else can you get from bloginfo function. * http://codex.wordpress.org/Function_Reference/bloginfo * * What else can you get from get_bloginfo function. * http://codex.wordpress.org/Function_Reference/get_bloginfo */ echo home_url(); // or bloginfo( 'url' ); // or echo get_bloginfo( 'url' ); Programming Language: PHP