WordPress.org

Support

Support » Installation » [Resolved] Child Page List in Sidebar Widgets

[Resolved] Child Page List in Sidebar Widgets

  • I’m using Ver. 2.1.2 with the Tiga-06 template. I’ve tried everything I can find to hide child pages in the sidebar “Pages” widget list. No go.

    When I go back to the default sidebar I can use the “depth=-1” attribute and it works just fine. But not with the widget. I’ve tried using the “exclude” attribute, I’ve tried the Navigo and Fold Page List plugins. No good.

    Any ideas?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Open the file widgets.php in the Sitebar Widgets plugin directory and locate

    function widget_pages($args) {
    	extract($args);
    	$options = get_option('widget_pages');
    	$title = empty($options['title']) ? __('Pages') : $options['title'];
    	echo $before_widget . $before_title . $title . $after_title . "<ul>\n";
    	wp_list_pages("title_li=");
    	echo "</ul>\n" . $after_widget;
    }

    then change wp_list_pages(“title_li=&depth=1“); to

    function widget_pages($args) {
    	extract($args);
    	$options = get_option('widget_pages');
    	$title = empty($options['title']) ? __('Pages') : $options['title'];
    	echo $before_widget . $before_title . $title . $after_title . "<ul>\n";
    	wp_list_pages("title_li=&depth=1");
    	echo "</ul>\n" . $after_widget;
    }

    I tried it and it works for me, at least.

    Yup,

    That fixed it. Don’t know how many times I lloked right past this code.

    I’ve tried adding de depth=1 argument but it still shows child pages…

    is there anything else i have to check?

    Ive also modified de

    ‘echo “\n” . $after_widget;’ to ‘echo “some text\n” . $after_widget;’to check, but “some text wasn’t written

    now i deleted the entire function widget_pages

    and it still displays all pages (including childs)

    What the hell?

    Hi Anabelle,
    I just ran into the same issue.
    I am using the TIGA theme and it work out that the theme uses its own version of widget_pages.

    In TIGA there is a tiga.php file in which the default function widget_pages is overwritten. Simply add the &depth=1 parameter there and it will work

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Child Page List in Sidebar Widgets’ is closed to new replies.
Skip to toolbar