• Resolved webrightnow

    (@webrightnow)


    Needing some help here.

    I can’t get the widget to display where I would expect it to.

    I would like to use this plugin to display a sidebar menu on any pages that have child pages. The menu should only show a list of each page’s children. From the description it seems this should be possible. I have created a page, then a child page, then activated the widget but nothing shows up on either the parent or child page. I have tried all the settings, including changing the levels etc. but so far nothing works. I got it to show up in posts, but even then it’s only showing a link to the category but not the actual posts, which is what I need.

    Is this possible? Ideally I’d prefer to use it with pages, not posts. Thanks.

    http://wordpress.org/plugins/advanced-sidebar-menu/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter webrightnow

    (@webrightnow)

    Actually I managed to do what I was after in a much simpler way. I dropped this bit of code into sidebar.php:

    <?php
    	if($post->post_parent)
    		$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=0");
    	else
    		$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0");
    	if ($children) { ?>
    		<ul id="subnav">
    			<h3>My subpages</h3>
    			<?php echo $children; ?>
    		</ul>
    <?php } ?>

    Works great. I’d still like to know if this plugin would have achieved the same thing.

    BTW thanks to kriesi.at for the code.

    Thread Starter webrightnow

    (@webrightnow)

    Sorry, that should read:

    <?php
    	if($post->post_parent)
    		$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->post_parent."&echo=0");
    	else
    		$children = wp_list_pages("title_li=&sort_column=menu_order&child_of=".$post->ID."&echo=0");
    	if ($children) { ?>
    		<h3>My subpages</h3>
    		<ul id="subnav">
    			<?php echo $children; ?>
    		</ul>
    <?php } ?>

    to avoid HTML errors.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Help! Can't get this to work’ is closed to new replies.