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'm stumped on this, it is something I've gotten to work on other sites, but I must be overlooking something here.

I'm trying to create a secondary menu for my custom post types ('staff') with wp_list_pages().

The function works fine if I'm tell it to return regular pages in the array parameter, but for some reason it doesn't return anything for my custom post type.

Here is where I create the custom post type:

    $staff_args = array(
    'public' => true,
    'supports' => array(
        'title', 'editor', 'thumbnail', 'custom_fields'
    'labels' => array(
        'name' => 'Staff Pages',
        'singular_name' => 'Staff Page',
        'add_new' => 'Add new Staff Page',
        'add_new_item' => 'Add new Staff Page',
        'edit_item' => 'Edit Staff Page',
        'new_item' => 'New Staff Page',
        'view_item' => 'View Staff Page',
        'search_item' => 'Search Staff Pages',
        'not_found' => 'No Staff Pages found',
        'not_found_in_trash' => 'No Staff Pages found in trash'
    'capability_type' => 'post',
    'hiearchial' => true,
    'rewrite' => array(
        'slug' => 'team',
    'has_archive' => false,
    'show_in_nav_menus' => true,
    'query_var' => 'staff',
    'menu_position' => 6,
    'menu_icon' =>  $url . '/custom-plugin/standalone_page.png'

register_post_type('staff', $staff_args);

Here is where I run wp_list_pages():

    $secondary_menu_args = array(
    'depth'        => 0,
    'show_date'    => '',
    'date_format'  => '',
    'child_of'     => 0,
    'exclude'      => '',
    'include'      => '',
    'title_li'     => _('Staff'),
    'echo'         => 1,
    'authors'      => '',
    'sort_column'  => 'post_title',
    'link_before'  => '',
    'link_after'   => '',
    'walker'       => '',
    'post_type'    => 'staff',
    'post_status'  => 'publish'


<nav id="secondary-menu" class="staff-menu">
    <li <?php if($postID == $post->ID) echo 'class="current_page_item"'; ?>><a href="/<?php echo $menu_url; ?>"><?php echo $menu_title; ?></a></li>
    <?php wp_list_pages($secondary_menu_args); ?>

Thanks in advance.

share|improve this question
This happens because you have a typo in your registration: 'hiearchial' => true. Use 'hierarchical' => true, and it should work. – toscho May 3 '13 at 21:49
@toscho as an answer please :) – Rarst May 4 '13 at 19:38
@Rarst Typos ar too localized. Waiting for feedback from asker. – toscho May 4 '13 at 19:48

Your Answer


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

Browse other questions tagged or ask your own question.