The functions below can be used to get the root domain of a WordPress site. If the site is a multisite network and you’re on http://www.site1.example.com/page-1/, calling¬†km_get_root_domain() would return example.com¬†for instance. It also works on single-site WP installations.

Leave a reply

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