Custom Post Type posts not displaying in edit.php

My custom post type posts are not showing at all in the edit.php page in my WordPress admin site:
wp-admin/edit.php?post_type=my_custom_post_type

However, the page shows the correct counts for the custom post types at the top:

Read More
All (3) | Published (2) | Draft (1)      3 items

The Add New link also works and I can create a new custom post type of this type, but when I save it as a draft or publish it, it does not show up in the list. The count value will increment, as if WordPress knows the article was published, but it is not showing in the edit.php list.

Has anyone seen this phenomenon before? Does anyone know what change could have caused this to happen? It was working fine before.

Related posts

2 comments

  1. For adding edit for your custom post type you can use..,

    ‘public’ => true,

    ‘publicly_queryable’ => true,

    For removing edit for your custom post type you can use..,

    ‘public’ => false,

    ‘publicly_queryable’ => false,

    *this is did not allow custom post type post to edit page *

    register_post_type( 'address',
            array(
                'labels' => array(
                    'name' => 'Address',
                    'singular_name' => 'Address',
                    'add_new' => 'Add New',
                    'add_new_item' => 'Add New Address',
                    'edit_item' => 'Edit Address',
                    'new_item' => 'New Address',
                    'view_item' => 'View Address',
                    'search_items' => 'Search Address',
                    'not_found' =>  'Nothing Found',
                    'not_found_in_trash' => 'Nothing found in the Trash',
                    'parent_item_colon' => ''
                ),
                'public' => true,
                'publicly_queryable' => true,
                'show_ui' => true,
                'query_var' => true,
                'rewrite' => true,
                'capability_type' => 'post',
                'hierarchical' => false,
                'menu_position' => null,
                'supports' => array('title','editor','thumbnail')
            )
        );
    
  2. I had the same problem. There was a function in functions.php file that caused the issue. I modified the main query in functions.php and I did not pay attention to the effect on the admin side.
    So where you modified the main query you need to check this is not admin area using

    !is_admin()
    

Comments are closed.