Not yet, i’ve got half a solution that can list custom post type pages and apply the correct style when they are active. But it’s a complete hack & I wouldn’t recommend using it.
This will create a list like this…
<?php
$defaults = array(
'depth' => 1,
'title_li' => '',
'echo' => 1,
'exclude' => 6,
'sort_column' => 'menu_order, post_title',
'sort_order' => 'asc',
'link_before' => '',
'link_after' => '');
global $post, $wp_query;
if (get_query_var('post_type') == 'shorts') {
// Load up the 'Case Studies' page to fool WP.
$page = get_page_by_title('Shorts');
$temp_post = $post; $temp_query = $wp_query; $wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array('page_id' => $page->ID));
wp_list_pages($defaults);
// Restore previous wp_query.
$wp_query = null; $wp_query = $temp_query; $post = $temp_post;
} else if (get_query_var('post_type') == 'features') {
// Load up the 'Partners' page to fool WP.
$page = get_page_by_title('Features');
$temp_post = $post; $temp_query = $wp_query; $wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array('page_id' => $page->ID));
wp_list_pages($defaults);
// Restore previous wp_query.
$wp_query = null; $wp_query = $temp_query; $post = $temp_post;
} else if (get_query_var('post_type') == 'musicvideos') {
// Load up the 'Partners' page to fool WP.
$page = get_page_by_title('Music Videos');
$temp_post = $post; $temp_query = $wp_query; $wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array('page_id' => $page->ID));
wp_list_pages($defaults);
// Restore previous wp_query.
$wp_query = null; $wp_query = $temp_query; $post = $temp_post;
} else if (get_query_var('post_type') == 'virals') {
// Load up the 'Partners' page to fool WP.
$page = get_page_by_title('Virals');
$temp_post = $post; $temp_query = $wp_query; $wp_query = null;
$wp_query = new WP_Query();
$wp_query->query(array('page_id' => $page->ID));
wp_list_pages($defaults);
// Restore previous wp_query.
$wp_query = null; $wp_query = $temp_query; $post = $temp_post;
} else {
// A normal page.
wp_list_pages($defaults);
}
?>
The options at the top will change the output however most of the variables only apply to pages, not post-types. I believe it creates a list like this:
- Custom Post Type(s) – Alphabetical
- Pages – Alphabetical