Why aren’t my custom post type posts showing up?

I created a custom post type – Press – using the following code in functions.php:

// Press Custom Post Type //

function press_custom_init() {

    $labels = array(
        'name' => _x('Press', 'post type general name'),
        'singular_name' => _x('Press', 'post type singular name'),
        'add_new' => _x('Add New', 'press'),
        'add_new_item' => __('Add New Press Item'),
        'edit_item' => __('Edit Item'),
        'new_item' => __('New Press Item'),
        'view_item' => __('View Press Item'),
        'search_items' => __('Search Press'),
        'not_found' =>  __('Nothing found'),
        'not_found_in_trash' => __('Nothing found in Trash'),
        'parent_item_colon' => ''
    );

    $args = array(
        'labels' => $labels,
        'public' => true,
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'show_in_nav_menus' => false,
        'query_var' => true,
        'rewrite' => array('slug','pages'),
        'capability_type' => 'post',
        'hierarchical' => false,
        'menu_position' => 5,
        'supports' => array('title','editor','thumbnail','excerpt',)
      );

    register_post_type( 'press' , $args );
}
add_action( 'init', 'press_custom_init' );

I have added items of that post type and added a menu item to my nav bar but when I click on the link, I get a ‘no posts found’ message.

Read More

You can see it here: http://s13.mynewsitereview.com//press

Please help!

Related posts

Leave a Reply

1 comment

  1. Just visit the Permalinks page http://yoursite.com/wp-admin/options-permalink.php in the WP-admin to fix this issue.

    Why?

    After creating any addons (post-type, taxonomies, ect.) in WordPress, WordPress needs to update/create a new set of rewrite rules (assuming you are using pretty permalinks). All you need to do is visit the permalinks page in your backend so that you can generate new rules for your new post type, ect. The technical term is Flushing Rewrite Rules (http://codex.wordpress.org/Function_Reference/flush_rewrite_rules)