• 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 file https://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') returns https://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]

Viewing 2 replies - 16 through 17 (of 17 total)
Viewing 2 replies - 16 through 17 (of 17 total)
  • The topic ‘Get multisite network base url?’ is closed to new replies.