Title: Empty post grid error message
Last modified: October 27, 2018

---

# Empty post grid error message

 *  Resolved [nprior](https://wordpress.org/support/users/nprior/)
 * (@nprior)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/empty-post-grid-error-message/)
 * When I insert a Post Grid which for the time being returns no posts but it will
   in due course, I get this error message both when I open the post to edit it 
   and at the top of the preview page:
 * Invalid argument supplied for foreach() in …. block-post-grid/index.php
 * When I set the grid so that it has entries error disappears.
 * Having an empty grid is valid if you are about to start publishing articles in
   a new category. As soon as I publish article 2 the grid will have entries and
   I don’t want to have to remember to go back to article 1 to re-edit it!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [David Rhoden](https://wordpress.org/support/users/davidrhoden/)
 * (@davidrhoden)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/empty-post-grid-error-message/#post-10843169)
 * I’m having the same error with Atomic Blocks Post Grid, but I **do** have posts
   present. They are custom posts. The custom posts type shows up in the list of
   available post sources in the Block Options, but the grid continues to say “No
   Posts Found”.
 * I’m guessing I did something wrong when creating the custom post type.
 * Here’s how it is configured:
 *     ```
       function create_post_type_project() {
         register_post_type( 'project',
           array(
             'labels' => array(
               'name' => __( 'Projects' ),
               'singular_name' => __( 'Project' ),
               'add_new' => __('Add new'),
               'add_new_item' => __('Add new project'),
               'view_item' => __('View project'),
               'edit_item' => __('Edit project'),
               'search_items' => __('Search projects'),
               'not_found' => __('Project not found'),
               'not_found_in_trash' => __('Project not found in Trash')
             ),
             'public' => true,
             'can_export' => true,
             'has_archive' => true,
             'show_in_nav_menus' => true,
             'show_in_rest' => true,
             'capability_type' => 'post',
             'publicly_queryable' => true,
             'query_var' => 'project',
                   'supports' => array(
               'title','editor','thumbnail','custom-fields','page-attributes','post-formats','author',
           	),
           )
         );
       }
       add_action( 'init', 'create_post_type_project' );
       ```
   
 *  Plugin Author [atomicblocks](https://wordpress.org/support/users/atomicblocks/)
 * (@atomicblocks)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/empty-post-grid-error-message/#post-10850133)
 * Hi [@nprior](https://wordpress.org/support/users/nprior/),
 * There is a fix for this in the next version of the plugin, thanks for the heads
   up!
 * Hi [@davidrhoden](https://wordpress.org/support/users/davidrhoden/),
 * The post grid doesn’t support custom post types yet, just standard posts. That’s
   why you’re not seeing those posts.
 *  Thread Starter [nprior](https://wordpress.org/support/users/nprior/)
 * (@nprior)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/empty-post-grid-error-message/#post-10850302)
 * Thanks – I’ll keep a look out for it!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Empty post grid error message’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/atomic-blocks_ded9f7.svg)
 * [Atomic Blocks - Gutenberg Blocks Collection](https://wordpress.org/plugins/atomic-blocks/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/atomic-blocks/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/atomic-blocks/)
 * [Active Topics](https://wordpress.org/support/plugin/atomic-blocks/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/atomic-blocks/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/atomic-blocks/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * 3 replies
 * 3 participants
 * Last reply from: [nprior](https://wordpress.org/support/users/nprior/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/empty-post-grid-error-message/#post-10850302)
 * Status: resolved