WordPress.org

Ready to get started?Download WordPress

Forums

One Home Page (2 posts)

  1. hgcs
    Member
    Posted 7 years ago #

    I have set up one of my Pages as a static front page. Unfortunately, this creates two links to the page in the list of pages, one labeled "Home" and one with the page name. How do I suppress the link for this page? It has an ID of 5, so I want to exclude 5 from the pages that are listed so that only the Home link brings you to this page.

    I looked up the documentation on how to do this at http://codex.wordpress.org/Template_Tags/wp_list_pages but I could not understand what I am supposed to do and where to do it. Can anyone here help me out? I am VERY frustrated.

    Howard

  2. fob
    Member
    Posted 7 years ago #

    This is just a template problem. Within your header id there is more than one request for the home link. One for the home page and one for the current page.

    You might want to exclude the current page link from your script making use of !is_home() ("if not is home") ...

    <?php if (!is_home() || !is_page(5)) { ?>
    -- your script --

    <?php } else { ?>

    ... (the links that should be shown on your home page) ...

    <?php } ?>

    I saw that on your home page it looks like this:
    ul li li /li /li /ul. May be you need to be careful how to change these tags depending on your CSS.

Topic Closed

This topic has been closed to new replies.

About this Topic