Get multisite network base url?
-
I can’t find the answer to this anywhere… hopefully I haven’t missed it somehow. I need to find a way to get the URL for the main parent blog for use in themes in the sub-blogs.
I am writing a theme/plugin package designed for multisite network blogs with a subdirectory configuration. There are several points where I need to include files that are in the “base” installation, but that will be used by a theme in the sub-blog.
As an example, the template file located in
https://www.domain.com/wordpress/blog2
needs to include the filehttps://www.domain.com/wordpress/wp-admin/includes/post.php
.Normally, I would use a relative path and add the site url to it, like so:
<?php $incPath = get_bloginfo('url') . '/wp-admin/includes/post.php'; ?>
However, because it’s network installation,
get_bloginfo('url')
returnshttps://www.domain.com/wordpress/blog2
, and so the include command doesn’t work.Is there any way to pull the URL of the parent blog (base, dashboard, main, I’m not sure what the proper terminology is)?
Thanks!
[moved to Multisite]
- The topic ‘Get multisite network base url?’ is closed to new replies.