Add class to the items in wp_list_pages

As wp_list_pages() has an argument of walker, you can use that to replace what is being used by walk_page_tree() as walker class internally.

@Brady has left a nice example in this answer.

class WPSE113482PageWalker extends Walker_Page
{
    function start_el( &$output, $page, $depth, $args, $current_page )
    {
        // Build $output here and apply your class for the active item
    }
}

You might also want to consider using wp_page_menu().

Leave a Comment