Forums

How to make 'pages' menu expanded (4 posts)

  1. Dennis
    Member
    Posted 2 years ago #

    Is it possible to make the 'Pages' menu in the sidebar.php expanded from when you are entering the site?

    If so, how can I do it?

  2. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Do you mean you want the Pages mane to show all child pages all of the time? Or are you looking for some sort of folding menu?

  3. huntlibtest
    Member
    Posted 2 years ago #

    I'm looking for a drop down menu on the left side nav
    sort of expanding like accordion.
    i have the spry asset form DRWVRM

  4. esmi
    Theme Diva & Forum Moderator
    Posted 2 years ago #

    Something like:

    <?php
    $my_pages = wp_list_pages('title_li=&depth=1&echo=0');
    if (is_page()) {
    	$this_page = $post->ID;
    	if ($post->post_parent) $this_page= $post->post_parent;
    	$children = get_page_children($this_page, get_pages());
    	if($children) {
    		$my_pages .= "<li>\n".'<ul class="subpages">';
    		foreach($children as $child) {
    			$my_pages .= wp_list_pages('title_li=&include='.$child->ID.'&echo=0');
    		}
    		$my_pages .= '</ul></li>';
    	}
    }
    echo $my_pages;
    ?>

    in your sidebar template should work.

Topic Closed

This topic has been closed to new replies.

About this Topic