WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've made a custom walker to use with wp_list_pages to modify the output to have thumbnails show. The goal is to have a list show up in a page template, which lists all children with their children.

The walker I have below seems to work for getting the thumbnail and page title but doesn't get the url of the page. Do I need to somehow use a getprefixed function instead of just esc_attr?

            class bio_walker extends Walker_Nav_Menu

            function start_el(&$output, $item, $depth, $args)

            $output .= "<li id='menu-item-$item->ID' class='bio-list'>";

            $attributes  = "class='highlight-$item->ID'";

            ! empty( $item->attr_title )
                and $attributes .= ' title="'  . esc_attr( $item->attr_title ) .'"';
            ! empty( $item->target )
                and $attributes .= ' target="' . esc_attr( $item->target     ) .'"';
            ! empty( $item->xfn )
                and $attributes .= ' rel="'    . esc_attr( $item->xfn        ) .'"';
            ! empty( $item->url )
                and $attributes .= ' href="'   . esc_attr( $item->url        ) .'"';

            $pageid = get_post_meta ( $item->ID, '_menu_item_object_id', true);
            $thumbnail = get_the_post_thumbnail( $item->ID, 'bio-thumb', true);

            $title = get_the_title($item->ID);

            $spanclass = "class='span-$item->ID bio-list-span'";

            $item_output = $args->before
                . "<a $attributes>"
                . $thumbnail
                . "<span $spanclass>"
                . $title
                . $pageid
                . "</span>"
                . '</a> ';

            $output .= apply_filters(
            ,   $item_output
            ,   $item
            ,   $depth
            ,   $args
share|improve this question
up vote 1 down vote accepted

figured it out - in case anyone else stumbles upon this with a similar question:

The proper walker to extend is Walker_Page, not Walker_Nav_Menu.

Walker_page is located in /wp-includes/post-template.php (line 978).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.