Forums

Main with secondary navigation using parent and child (2 posts)

  1. bmohr
    Member
    Posted 1 month ago #

    I'm currently installing main navigation on my site:
    http://www.mohrdesigns.com/consumer-products

    code in header file:

    <ul id="nav" class="solidblockmenu">
    <?php wp_list_pages('sort_column=menu_order&title_li=&depth=1'); ?>
    </ul>
    
    <?php if($post->post_parent)
    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0"); else
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
    if ($children) { ?>
    
    <ul id="subnav">
    <?php echo $children; ?>
    </ul>
    <?php } else { ?>
    <?php } ?>

    This does everything I want it to do EXCEPT I want to allow the user the ability to roll over any of the top level (parent) links and they can then view the second level (child) links. Regardless of what page they're on. How can I do this?

  2. adiant
    Member
    Posted 1 month ago #

    May I refer you to this thread? http://wordpress.org/support/topic/318146?replies=4

    Bottom line: writing your own drop-down menu is something I tried and it worked. BUT only on IE8! Getting it to work on all browsers is tough and best left to a plug-in where someone spent the time to make it work on all browsers.

    In case it isn't clear in that referenced post: the php code is relatively easy. It is the CSS (style sheet) coding that almost kills you to get right for all browsers.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.