• Resolved BothHands

    (@bothhands)


    I’m working on a localhost in XAMPP. My first WP site, and it’s been challenging (yikes) but I’m finally starting to catch on.

    Each new post displays on the site’s front page, though there seems to be no actual front page (as there would be an index.html page).

    I had been going down the wrong design path, trying to implement a static front page. My main navigation menu has a “HOME” link, and that link used to point to the static front page. It worked.

    Now I have no static front page. Settings >> Reading states:
    Front page displays Your latest posts.

    I edited my nav menu so its “HOME” link now points to URL https://localhost/mydomain/ rather than to a page. It works in the localhost environment, BUT…

    QUESTION 1
    What will happen to this link when I migrate the site to the online hosting environment? Will it auto-update to the new/correct URL?

    QUESTION 2
    Is there a BETTER WAY to point the nav menu “HOME” link to the front of this WP site?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Make your home link:

    <a href="/">Home</a>

    This should work no matter what your current domain is, localhost or a real domain. If you’re using the built in menu system, simply put in “/” in the link field.

    Thread Starter BothHands

    (@bothhands)

    Thanks, Chris. I have a problem, though.

    Dashboard > Appearance > Menus > Menu Structure pane

    1. I enter the following for menu item HOME:
    URL: https://localhost/(name of my local WP subdirectory)/
    Navigation Label: HOME

    When I select the HOME nav menu link, I’m taken to my intended front page. It works.

    2. Next I enter the following for menu item HOME, per my (limited) understanding of your suggestion:
    URL: /
    Navigation Label: HOME

    When I select the HOME nav menu link, I’m taken to my XAMPP front page at this URL: localhost/xxamp (a very, very ORANGE experience, ha)

    Can you resolve this for me? I’m brand new at WordPress and have ZERO experience with coding, so hopefully your further suggestion will be something I can handle within the WP Dashboard. Or if you explain where/how to add <a href='/'>HOME</a>, I’ll give that a try.

    Thanks

    Thread Starter BothHands

    (@bothhands)

    INTERESTING COINCIDENCE (if you believe in those)

    I googled up THIS wpbeginner link dated June 2012, entitled “How to Show Home Page Link in WordPress 3.0 Menu“. It states:

    “First open your theme’s functions.php file and paste the following code:

    function home_page_menu_args( $args ) {
        $args['show_home'] = true;
        return $args;
        }
        add_filter( 'wp_page_menu_args', 'home_page_menu_args' );

    Once you have pasted this code, It should add “Home” as an option under the “Pages” widget on the Menu management page so the user can simply check it off as an item to add to their custom menu.”

    It worked as described. The result is EXACTLY the result I got by thrashing about in the Dashboard > Appearance > Menus screen. I typed in https://localhost/wp-dir (name of xampp subdir containing my WP installation). It works, at least within the localhost environment (gee, maybe I’m a ‘natural’…)

    Anybody know if this will hold up when I MIGRATE THE LOCALHOST SITE TO MY ONLINE HOSTING? (my original question)

    PS. I’m using WP 4.1.1. The “Home” page option created by the function.php mod (for WP 3.0) might have been present initially, and I might have accidentally deleted it. Anybody know for sure?

    Thanks

    In the General screen of settings, what do you have for your WordPress URL and Home URL?

    The Home option is actually there automatically in 4.1.1, under the Pages section in the Menu editor, click View All, and you’ll have Home there. This makes a custom link. I’m not sure this would get updated automatically, but it depends on what tool you use to migrate your site.

    Is there some reason it wouldn’t be possible to simply edit the menu after you migrate the site?

    Thread Starter BothHands

    (@bothhands)

    Dashboard > Settings > General

    WordPress Address (URL): https://localhost/wp-dir

    Site Address URL: (http)://localhost/wp-dir

    I’m not sure if it’s possible to delete that Home option from the v4.1.1 Pages section of the Menu Editor. If it is possible, I probably deleted it. I set up several HOME pages while trying to figure out whether I needed a static front page or not, and ultimately deleted them all.

    I intend to use the DUPLICATOR Plugin (LifeintheGrid) to migrate the site to online hosting. Does anybody know if that’ll automatically update this ‘Home’ nav link?

    Actually, that wpbeginner instructions page (see link above) didn’t seem to indicate there’d be any problem with that fix when migrating. Seemed like a universal fix, and it’s what I have now…

    Fingers crossed. And sure, I can update the link once I migrate the site, but if I have to remember to do it EVERY TIME I update the site, well…you know what’ll happen eventually (and it’s the HOME page link, too).

    I sure would appreciate a rock-solid answer to this…

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Nav menu "HOME" link on a site with NO static front page’ is closed to new replies.