Vijaya Narayanasamy
Vijaya Narayanasamy

Reputation: 468

to list out my submenus of particular menu only in wordpress

  1. Want to show my sub menus on by left sidebar with links on my main menus page.
  2. I used this code

    post_title; wp_list_pages('title_li=&child_of=$menu_name&depth=2'); ?>
  3. Any help.Thanks in advance.

Upvotes: 1

Views: 1544

Answers (1)

Libin
Libin

Reputation: 2462

Check this plugin: JQuery Accordion Menu Widget

Create the menu you want using WordPress Menu (Dashboard -> Appearance -> Menus) and use the above plugin to display your menu on sidebar with Accordion effect. :)

UPDATE

The following code List Sub-Pages, if you are on a parent page and have some child. Place this code on your sidebar.php

<?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>
  <?php echo $children; ?>
  </ul>
  <?php } ?>

Check this wordpress codex section for more details

Upvotes: 1

Related Questions