theme development – get main URL from subdirectory with php

Question

I have a WordPress site that contains multiple subdirectory installations of WordPress with individual databases inside one WordPress installation, and I want to link them together in the themes. But I couldn’t figure out how to dynamically get the main URL from the base WordPress directory for one of the subdirectories.

For example, I tried to use get_home_url() but it only returns https://mytestsite.com/instance1 instead of https://mytestsite.com

This might be something basic but i couldn’t find anything in my resarch that could help me out.

0
Pelle 1 year 2022-02-16T06:08:34-05:00 0 Answers 0 views 0

Leave an answer

Browse
Browse