WordPress.org

Ready to get started?Download WordPress

Forums

categories as navigation (4 posts)

  1. marisaharwood
    Member
    Posted 3 years ago #

    Hi,

    I'm very new to wordpress and I'm trying to get my main navigational menu to link to my categories. Can anyone help as I've tried loads and nothing works!

    <ul id="nav">
                    <li class="pensions"><a href="#">pensions</a></li>
                    <li class="money"><a href="#">everyday money</a></li>
                    <li class="mortgages"><a href="#">mortgages</a></li>
                    <li class="savings"><a href="#">investments</a></li>
                    <li class="protections"><a href="#">protections</a></li>
                </ul>
  2. esmi
    Forum Moderator
    Posted 3 years ago #

  3. marisaharwood
    Member
    Posted 3 years ago #

    I've tried using this, but it doesn't work

    <li class="pensions"><a href="<?php wp_list_categories('orderby=name&include=3'); ?> ">pensions</a></li>
                    <li class="money"><a href="<?php wp_list_categories('orderby=name&include=4'); ?> ">everyday money</a></li>
                    <li class="mortgages"><a href="<?php wp_list_categories('orderby=name&include=5'); ?> ">pensions</a></li>
  4. Kapil Chugh
    Member
    Posted 3 years ago #

    use this code

      <?php wp_list_categories('orderby=name&depth=1&hide_empty=0&title_li='); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags