Skip to content

Latest commit

 

History

History
24 lines (15 loc) · 647 Bytes

how-to-get-the-site-url-in-wordpress-using-php.md

File metadata and controls

24 lines (15 loc) · 647 Bytes

How to get the site URL in WordPress using PHP?

// plain

The site URL in WordPress can be retrieved using the home_url() function in PHP. This function returns the home URL of the site.

<?php
echo home_url();
?>

The output of the above code will be the home URL of the site.

Code explanation

  1. home_url() - This function returns the home URL of the site.

Helpful links

  1. WordPress home_url() Function

onelinerhub: How to get the site URL in WordPress using PHP?