WordPress.org

Ready to get started?Download WordPress

Forums

Multisite Site Url Question (8 posts)

  1. ParticularlyEvil
    Member
    Posted 3 years ago #

    This may be incredibly stupid.

    How do I get the url of the "main" site for my Multisite Install?

    <?php echo get_settings('home'); ?> Gives me the home page of the current blog, not the core blog as does <?php echo site_url() ?> and everything else I've tried

    I'm sure this is simple, but I can't find the information anywhere!

    Thanks
    Frank

  2. ParticularlyEvil
    Member
    Posted 3 years ago #

    Anyone?

  3. It should be get_current_site() but I often get that and get_bloginfo() crossed...

  4. ParticularlyEvil
    Member
    Posted 3 years ago #

    I believe get_current_site gets the current site you are browsing, so in a multisite install, that wouldn't be the core site.

    I'm looking for the code for getting the core site itself.

    Any other ideas?

  5. No, I know, there's just some insane weird naming convention for it that never makes logical sense for me, y'know? :)

    I mean, you could do get_blog_option() and then specify the site but that's silly.

    *pulling out old notes and reading*

  6. AH! Thank you @wpmuguru!

    network_home_url()

    Which is only mentioned here: http://codex.wordpress.org/Determining_Plugin_and_Content_Directories

  7. I believe get_current_site gets the current site you are browsing, so in a multisite install, that wouldn't be the core site.

    Actually, it should be. close enough, anyway. In the code site refers to the network, blog refers to what the admin area calls sites. (just for code clarification)

    the function mentioned above is what you're looking for tho.

  8. luminancedesign
    Member
    Posted 2 years ago #

    I've just used:

    <?php echo get_home_url('1','/'); ?>

    To get the main site [ID 1] - hope this helps!

    From: http://codex.wordpress.org/Function_Reference/get_home_url

Topic Closed

This topic has been closed to new replies.

About this Topic