From 8b0bd629d48be64b534278c04dbc8d35133148cb Mon Sep 17 00:00:00 2001 From: Adam Bowen Date: Tue, 13 Sep 2011 12:31:50 -0300 Subject: [PATCH] Fixes "Trying to get property of non-object" error on 404 pages `$post` is not set if you are on a 404 page, so we need to check if it is set before we call `$post->post_name`, etc. (note that you would have to have `WP_DEBUG` set to `true` in wp-config.php in order to see this issue) --- header.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/header.php b/header.php index b04d48b..e22e881 100644 --- a/header.php +++ b/header.php @@ -25,7 +25,12 @@ -post_name; body_class($page_slug); ?>> +post_name; + body_class($page_slug); + } else { + body_class(); + }?>>