Title: Help with -&gt; Warning: Creating default object from empty value
Last modified: September 14, 2020

---

# Help with -> Warning: Creating default object from empty value

 *  [lgehrig4](https://wordpress.org/support/users/lgehrig4/)
 * (@lgehrig4)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/help-with-warning-creating-default-object-from-empty-value/)
 * I’m building a custom theme for my portfolio and learning as I go. I made a rookie
   mistake which I desperately need assistance with.
 * My theme will has both default and custom posts with categories that will be 
   queryable and displayed on separate pages. The default post category queries 
   go to category.php, but the the custom post’s were giving a 404, which I was 
   in the process of working out. For some reason one of the custom post categories
   would send me to category.php and display a default post that wasn’t even an 
   active post in my admin panel. It was something I had either deleted or changed.
 * I decided to make sure everything was cleared out so I deleted all of these posts
   from the phpMyAdmin panel. I accidentally also deleted the blog page as well.
   I created a new blog page and menu item for it and now I get these errors
 * > Warning: Creating default object from empty value in /Applications/MAMP/htdocs/
   > wordpress6/wp-admin/includes/nav-menu.php on line 407
 * > Notice: Undefined property: stdClass::$ID in /Applications/MAMP/htdocs/wordpress6/
   > wp-admin/includes/nav-menu.php on line 410
 * This is the function that it’s referring to. The first line code starts on line
   405 of the file:
 *     ```
       if ( ! empty( $posts_page ) ) {
       			$posts_page_obj             = get_post( $posts_page );
       			$posts_page_obj->posts_page = true;
   
       			$important_pages[]   = $posts_page_obj;
       			$suppress_page_ids[] = $posts_page_obj->ID;
       		}
       ```
   
 * I really don’t know where to start with this or why I’m getting it since I simply
   replaced the page and menu link with the same thing that was deleted. I’m doing
   this locally on MAMP btw.

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

 *  Thread Starter [lgehrig4](https://wordpress.org/support/users/lgehrig4/)
 * (@lgehrig4)
 * [5 years, 9 months ago](https://wordpress.org/support/topic/help-with-warning-creating-default-object-from-empty-value/#post-13404652)
 * Update: I took the easy way out. Created a new instance/database and copied all
   the files over.
 * I would still like to understand what I may have done, and even try to fix the
   old site if anyone has suggesstions.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/help-with-warning-creating-default-object-from-empty-value/#post-13416350)
 * I think it was because you have your site set to display a “static” front page,
   but you did not specify a “posts” page for use in showing a blog listing. Even
   if you don’t intend to use it, you have to specify one. Maybe at one time you
   did have a page set for posts, but if you then deleted that page, it’d be as 
   though one was never specified.
 *  Thread Starter [lgehrig4](https://wordpress.org/support/users/lgehrig4/)
 * (@lgehrig4)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/help-with-warning-creating-default-object-from-empty-value/#post-13419759)
 * Yes, that was it. Didn’t even think to revisit that after I had deleted the page
   and replaced it. At least I know this for the future. Thx!

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

The topic ‘Help with -> Warning: Creating default object from empty value’ is closed
to new replies.

## Tags

 * [custom theme](https://wordpress.org/support/topic-tag/custom-theme/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 3 replies
 * 2 participants
 * Last reply from: [lgehrig4](https://wordpress.org/support/users/lgehrig4/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/help-with-warning-creating-default-object-from-empty-value/#post-13419759)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
