WordPress.org

Ready to get started?Download WordPress

Forums

Help with category drop down menu (3 posts)

  1. lordicefalcon
    Member
    Posted 3 years 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">
    <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    <?php wp_list_pages('title_li=&depth=4&sort_column=menu_order'); ?>
    <li><a href="#">Categories</a>
    <ul><?php wp_list_categories('title_li=&depth=4&orderby=name'); ?></ul>

    </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

  2. alchymyth
    The Sweeper & Moderator
    Posted 3 years ago #

    this could work in principle:

    <div id="navbarleft">
    <ul id="nav">
    <li><a href="<?php echo get_settings('home'); ?>">Home</a></li>
    <?php wp_list_pages('title_li=&depth=4&sort_column=menu_order'); ?>
    <?php wp_list_categories('title_li=&depth=4&orderby=name'); ?></ul>
    </div>

    however, there is not enough space for all parent categories plus the searchbar; and you also need to adjust the width of #navbarleft in style.css

  3. sagdude2002
    Member
    Posted 3 years ago #

    I'm not a real expert but it looks like your code is ok. If you create a page with no parent, the title of that page should show up on your navigation bar.

    If you want a child page listed underneath a parent, simply put the parent title in the parent field under Page Attributes when you create the child. I hope this is at least of some help.

Topic Closed

This topic has been closed to new replies.

About this Topic