Forums

Help with category drop down menu (3 posts)

  1. lordicefalcon
    Member
    Posted 1 year ago #

    Good Afternoon,

    I am trying to find a little bit of help. basically I have my site about 60-70% done, but an now working on fine tuning the details. If you head over to Dorkutopia.com and check out the top navbar it has three listed drop downs.

    Home | DU HQ | Categories

    And i have the code set up like so

    <div id="navbarleft">
    <ul id="nav">

  2. ">Home
  3. <?php wp_list_pages('title_li=&depth=4&sort_column=menu_order'); ?>

  4. Categories
      <?php wp_list_categories('title_li=&depth=4&orderby=name'); ?>
  5. </div>

    Basically, I would like to break it down so my parent categories are listed across the nav bar, with the children as drop downs. I can seem to figure out what I am missing as I the tutorials and PhP i found just broke the layout of my site.

    Any help would be appreciated

  6. converting2wp
    Member
    Posted 1 year ago #

    If your top-level categories don't change often, you could put the text for them in the nav bar and then show just their children as in:

    http://codex.wordpress.org/Template_Tags/wp_list_categories#Only_Show_Children_of_a_Category

    If you don't want to worry about changing the menu when you add/delete a top-level category, you'll need another loop in your menu code and you might use the get_categories and get_category_link functions.

    You'll probably need to make sure the lists match up with what your theme/css is expecting, and decide whether a top level category with children is a link or not.

  7. converting2wp
    Member
    Posted 1 year ago #

    Or, simpler, what if you take out the "Categories" and the "UL" tags underneath it Doesn't that give you your top level categories at the same level as "DU HQ"?

    But I may be completely missing your point.

Topic Closed

This topic has been closed to new replies.

About this Topic