0

I'm making a custom Wordpress theme. At some point, the "Customize" page in the admin panel has completely broken, giving me tons of these errors:

Notice: Trying to get property 'post_status' of non-object in /var/www/html/wp-admin/includes/template.php on line 2233

Notice: Trying to get property 'post_status' of non-object in /var/www/html/wp-admin/includes/template.php on line 2237

Notice: Trying to get property 'post_status' of non-object in /var/www/html/wp-admin/includes/template.php on line 2243

Notice: Trying to get property 'post_status' of non-object in /var/www/html/wp-admin/includes/template.php on line 2247

Notice: Trying to get property 'ID' of non-object in /var/www/html/wp-admin/includes/template.php on line 2251

Notice: Trying to get property 'post_status' of non-object in /var/www/html/wp-admin/includes/template.php on line 2255

Notice: Trying to get property 'ID' of non-object in /var/www/html/wp-admin/includes/template.php on line 2260

Notice: Trying to get property 'ID' of non-object in /var/www/html/wp-admin/includes/template.php on line 2264

Notice: Trying to get property 'ID' of non-object in /var/www/html/wp-admin/includes/template.php on line 2269

My page seems to work just fine otherwise, I don't get any warnings anywhere else.

How do I even begin to debug this?

1 Answer 1

1

I figured this out while writing the question, but I thought I'd post it anyway since I couldn't find the answer to this on Google.

It turns out I had deleted a page at some point, but I had a menu item that still pointed to that deleted page. That menu item caused all these errors.

Deleting the invalid menu item fixed the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.