Just a quick answer to a question that came up while building a theme for a client…
If you’re editing the PHP for your theme and come across issues while using “site_url“, you may need to swap it out for “home_url“.
“site_url” references the directory or folder that the site is installed in – which could be the root, but often isn’t. This is also known as the “WordPress Address” under Settings > General in the Admin area.
“home_url” references the actual home URL of the site – www.yoursite.com. This field is the “Site Address” in Settings > General.