WordPress.org

Ready to get started?Download WordPress

Forums

get_blogaddress_by_name() issues (2 posts)

  1. Kim Parsell
    Volunteer Moderator
    Posted 4 years ago #

    I'm working with 3.0-alpha in multisite mode (using subdirectories), and have run across an issue with the get_blogaddress_by_name() function.

    I used that function to pull in the link for the main blog in the theme for blog 2, and it worked as expected (get_blogaddress_by_name('Main') returns http://domain.tld/).

    However, when I include it in a custom function in functions.php in the blog 2 theme, it is not returning just the url, it is also appending the name of the blog to the end of the url (get_blogaddress_by_name('Main') returns http://domain.tld/Main/).

    I've searched the forums and Trac for anyone else experiencing this issue, and found nothing.

    Is this expected behavior or a bug?

  2. Kim Parsell
    Volunteer Moderator
    Posted 4 years ago #

    Quick update: I changed that function to use get_blogaddress_by_id() instead, and it returns the correct URL for the main blog.

    Would still like to know why get_blogaddress_by_name is appending the blog name to the url when using subdirectories.

Topic Closed

This topic has been closed to new replies.

About this Topic