Create dynamic secondary menu? (3 posts)

  1. coseeflorida
    Posted 3 years ago #

    I would like to use the secondary menu in Oxygen to have page-specific menus (e.g. they would all be different). It seems that the template is set up to have one static menu that appears on all pages. Would someone be able to point me in the right direction to modify this? My site is locally hosted, so apologies that I can't link to it.

  2. Griden
    Theme Author

    Posted 3 years ago #

    Try some plugin like Widget Context: http://wordpress.org/extend/plugins/widget-context/.

  3. ajcke
    Posted 3 years ago #

    You don't need a plugin. I'm using the following code to accomplish this. This code displays the parent page with the h2 tag and then the children pages are listed in an unordered list.

    <div id="menu-secondary">
      if($post->post_parent) {
      $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
      $titlenamer = get_the_title($post->post_parent);
      else {
      $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
      $titlenamer = get_the_title($post->ID);
      if ($children) { ?>
     <h2 class="parent"> <?php echo $titlenamer; ?> </h2> 
      <?php echo $children; ?>
    <?php } ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum's parser.]

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic