Which function is used to get home URL in WordPress?

get_home_url(); and home_url(); functions is used to get home url in WordPress.

// Example to get home url
$url = home_url();
echo $url;
// Output: https://example.com

// Example to get url of any page using slug
$url = home_url().'/about';
echo $url;
// Output: https://example.com/about

Learn more about the similar topics:
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.