WordPress.org

Ready to get started?Download WordPress

Forums

Sub Nav solution (2 posts)

  1. jkinley
    Member
    Posted 8 months ago #

    Hi, I am looking for a simple way to have a sidebar nav in sidebar.php. I want the nav to list the top level pages for the page 'services'. Then you have a list of top level services. If you click on one of those links then the list shows the children of that category but not the children of the other top level parents. This code seems to work, but I can't believe it. Any other ideas?

    <?php

    $children = wp_list_pages('title_li=&child_of=11&echo=0');
    if ($children) { ?>

      <?php echo $children; ?>

    <?php } ?>

  2. blacklinemedia
    Member
    Posted 8 months ago #

    Hi

    Unless you are creating a plugin, I would simply advice creating a new custom menu, and then using the default wordpress Menu Widget to display it, in your sidebar.

Reply

You must log in to post.

About this Topic

Tags

No tags yet.