WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Static Front Page problem (3 posts)

  1. eclerkin
    Member
    Posted 4 years ago #

    I created a Static Front Page per the directions of a Codex article Creating A Static Front Page. However, I am seeing 2 "Host" navigation buttons on the menu bar as stated in the Troubleshooting Themes section. The instructions state the following:

    Navigation Bars
    Some themes have top navigation bar containing links to Pages. By default most themes set "Home" as a link to the home page - in this case the static front page. Since you have created a separate page with the title "Home", there is a likelihood of another link text appearing as "Home".

    To change it, edit the appropriate template file featuring the code of the navigation bar with the template tag wp_list_pages. Set the parameters to change the link title.

    Set the parameters to what?

    Below is the navigation code from Header.php which I believe is the correct place to fix the problem. However, what am I supposed to change to resolve this problem?

    <!-- Main nav Starts here -->
            <div id="navouter">
                <div id="nav">
    
                    <ul id="dropmenu">
                    <li class="page_item <?php if ( is_home() ) { ?>current_page_item<?php } ?>"><a href="<?php bloginfo('url'); ?>">Home</a></li>
                    <?php /* Navigation */
                    	wp_list_pages('title_li=&depth=0&sort_column=menu_order&child_of=0');
                    ?>
                    </ul>
    
                </div>
            </div>
            <!-- Main nav Ends -->
  2. jrav001
    Member
    Posted 4 years ago #

    Change it to this:

    <!-- Main nav Starts here -->
    <div id="navouter">
    <div id="nav">
    <ul id="dropmenu">
    <?php /* Navigation */
    wp_list_pages('title_li=&depth=0&sort_column=menu_order&child_of=0');
    ?>
    </ul>
    </div>
    </div>
    <!-- Main nav Ends -->

    We have removed one line which no longer applies.

  3. eclerkin
    Member
    Posted 4 years ago #

    Perfect - Thanks! I actually commented out the code with a comment for future reference since it applies to other templates as well.

    <ul id="dropmenu">
    <!-- Using a Static Home Page requires removing the following line of code -->
    <!-- <li class="page_item <?php if ( is_home() ) { ?>current_page_item<?php } ?>">">Home -->
    <?php /* Navigation */
    wp_list_pages('title_li=&depth=0&sort_column=menu_order&child_of=0');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic