Custom Post Type Archives
-
I created a custom post type (newradio) and have the main archive page working. So if I go to mysite.com/newradio the archive shows up fine. I want to have an archive list list the posts page so that if I go to mysite.com/newradio/2016 it will show all for 2016 and mysite.com/newradio/2016/06 will show all for June of 2016. I get an error 404 for any of the filtered down archive pages.
Is there something in my definition of my post type that needs to change?
$labels = array( 'name' => _x('Our Radio', 'post type general name'), 'singular_name' => _x('Our Radios', 'post type singular name'), 'add_new' => _x('Add New', 'our_classes'), 'add_new_item' => __('Add Radio'), 'edit_item' => __('Edit Radio'), 'new_item' => __('Add Radio'), 'all_items' => __('All Radios'), 'view_item' => __('View Our Radio'), 'search_items' => __('Search Radio'), 'not_found' => __('No Result found'), 'not_found_in_trash' => __('No Result found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Radio Shows' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'supports' => array('title', 'editor', 'thumbnail','excerpt') ); register_post_type('newRadio', $args);
Or do I need to do something in my archive page or with pre_get_posts? I feel like I’m missing something basic that will enable this.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom Post Type Archives’ is closed to new replies.