WordPress.org

Ready to get started?Download WordPress

Forums

"Home" link not working on subsites (4 posts)

  1. AsraiLight
    Member
    Posted 1 year ago #

    Yet another issue with my new installation of a WP network.

    The "Home" link on my subsites is directing to the home page of the network's main site, not the homepage of the subsite. So if I'm on http://example.com/foo, no matter what page I select as my default static page in Settings > Reading, that link in the menu will go to http://example.com.

    I assume this is an issue with my theme and how it generates the menu? Though I'm having trouble digging into the files to find exactly where I can edit the menu.

    The other odd thing is that the logo on the site, in the header, functions correctly. It links to http://example.com/foo.

  2. Curtiss Grymala
    Member
    Posted 1 year ago #

    Which "Home" link? Is this something that's in your theme, is it something that you added using a plugin or a menu?

  3. AsraiLight
    Member
    Posted 1 year ago #

    I use the built-in WP menu setup to make my navigation, and use a static front page. No matter what that static front page is, the link in the menu to go to it takes the user to the base URL rather than the subsite's sub-directory.

    Unfortunately I inherited this custom theme, and have to edit it. From what I can tell, the theme sends any link to the front static page to "/", which redirects back to the base URL instead.

    I'm just not sure where, in the theme files, I would find the menu. Once I do, what would be the proper link to send the home page link to, rather than "/"?

  4. Curtiss Grymala
    Member
    Posted 1 year ago #

    Rather than using "/", you should use <?php bloginfo( 'url' ) ?> or <?php echo get_bloginfo( 'url' ) ?>.

    If I had to guess, I'd say that the menu you need to edit is in either the index.php file or the header.php file (if that exists), but I can't say for certain.

    Theme authors can put menus just about anywhere they want, and, judging by the fact that the original theme author used "/" for the home URL, that person probably didn't follow too many standards in developing the theme (not slagging on the developer - whenever I look at themes I developed 3 or 4 years ago, I'm appalled at how bad my code was, too).

Topic Closed

This topic has been closed to new replies.

About this Topic