For our customization want to get site URL in WordPress programmatically then use the following code. Here $url returns the site URL of a WordPress.

$url = site_url();
echo $url;

Have any doubt, then comment here!

Leave a Reply

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