Word Press – Duplicate Home Links

If you find yourself using WordPress as a framework for maintaining a webseite, and you are interested in having a STATIC home page, rather than the BLOG, you may have encountered the issue where you have TWO home links on your navigation bar.

WordPress Two Homes

One option is to use the WordPress suggested “parent page selection” option.  Basically, this option allows you to identify your static home page as having a parent.  If the template only shows the TOP of this tree, this will work.

If the template also shows “Children” this may not produce the results you want.

The more direct option is to modify the template you are using.  Depending on who and how your template is written, it may have a hard coded HOME link.  The one that I was testing at the time did.  I was able to find the link under:

Appearance – Editor – Header.php

Looking through the code, you will find something similar to this.  The note here is the <li tag and the HOME text.

<li <?php if(is_front_page()) { ?>class="current_page_item"<?php } ?>><a href="<?php echo get_option('home'); ?>/">Home</a></li>

All I did was comment out this list item with html comment tags.

 <!--li <?php if(is_front_page()) { ?>class="current_page_item"<?php } ?>><a href="<?php echo get_option('home'); ?>/">Home</a></li -->

That should result in only a single home link.. The PAGE link.  This process removes the DEFAULT home that would normally point to the BLOG page.

Note – Fix the order by the order value in the page setup.  Results may very depending on your source template.

Leave a Reply

Your email address will not be published. Required fields are marked *