WordPress.org

Ready to get started?Download WordPress

Forums

Changing Navigation Bar Links (5 posts)

  1. screentan
    Member
    Posted 5 years ago #

    I am using the Techland theme and want to change the navigation bar menu buttons so that they link to categories instead of static pages. Is this possible and if so how do I change it to do this please?

    Many Thanks
    SC

  2. popper
    Member
    Posted 5 years ago #

    Look for <? wp_list_categories('sort_column=menu_order&title_li='); ?>
    wp_list_pages in your header.php and change it to wp_list_categories

    Hope that helps!

  3. screentan
    Member
    Posted 5 years ago #

    That's awesome thanks! I guess there isn't a way to have a combination of links to static pages and categories on the menu bar is there? i.e. what if I wanted the majority of the menu buttons to link to static pages but just one of the menu buttons to link to a category instead. Is this possible at all?

  4. popper
    Member
    Posted 5 years ago #

    If it's just one, I'd suggest coding it the old-fashioned way. Lets say you hay your menu in a div with id="menu". Your code would be something along the lines of:

    <div id="menu>
    <ul>
    <?php wp_list_pages('sort_column=menu_order&amp;title_li=';?>
    </ul>
    </div>

    you could just add the category link like

    <li><a href="yoursite.com/category">Category</a></li>

    So it would look something like this:

    <div id="menu>
    <ul>
    <?php wp_list_pages('sort_column=menu_order&amp;title_li=';?>
    <li><a href="yoursite.com/category">Category</a></li>
    </ul>
    </div>

    The other option is to just use <?php wp_list_categories(sort_column=menu_order&amp;title_li=&amp;exclude=X,Y,Z'): ?> Where you exclude every cat except for the one(s) you want to show.

  5. screentan
    Member
    Posted 5 years ago #

    This is a great help. Thanks so much for helping this total newb!

Topic Closed

This topic has been closed to new replies.

About this Topic