WordPress.org

Ready to get started?Download WordPress

Forums

Static Homepage link (2 posts)

  1. chaz7979
    Member
    Posted 9 years ago #

    I searched and found other topics about this but they were all closed. My question is how do I add a static "home" link that points to the root of my domain under the "pages" links on my site.

    on a realted thought, I see a lot of sites with their "pages" links accross the top of the header running horizontally instead of vertically in the sidebar, how is this done? Seems the word "pages" is taken out completely.

    Is it all just hardcoded?

  2. Minna
    Member
    Posted 9 years ago #

    For example:
    <ul>
    <li><a href="#">Home</a></li>
    <?php wp_list_pages('title_li='); ?>
    </ul>

    The important part is that title_li= with nothing after it. From Codex: "Displays no heading for list, and list is not wrapped in <li><ul>, </ul></li> tags. (Note the absence of any space after the = sign.)" That is, the page links will be in <li></li> tags so you can add more of those before and after the template tag. That is why you also need to add the <ul></ul> tags.

    Naturally, if you already have title_li or other parametres in the tag you need to either change title_li to nothing or add it in the parametre list as &title_li= (there are examples on the Codex page I linked to).

    As to your other question, see Creating Horizontal Menus at the Codex.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.