From 3fedf50dcb2608422b797cad38592aab2bb521c1 Mon Sep 17 00:00:00 2001 From: Chris Meller Date: Thu, 24 Nov 2011 20:57:24 -0500 Subject: [PATCH] Why the hell would $posts be an instance of a single Post, I ask you? Why? *blows brains out* --- classes/theme.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/classes/theme.php b/classes/theme.php index 22178e196..18e4e347e 100644 --- a/classes/theme.php +++ b/classes/theme.php @@ -343,9 +343,12 @@ public function act_display( $paramarray = array( 'user_filters'=> array() ) ) if ( isset( $posts ) && count( $posts ) > 0 ) { // actually find the most recent post in the list, just in case they've been re-ordered - if ( count( $posts ) == 1 ) { + if ( $posts instanceof Post ) { $newest_post = $posts; } + else if ( count( $posts ) == 1 ) { + $newest_post = $posts[0]; + } else { $newest_post = reset( $posts ); // prime with the first one, just so we've got a real object foreach ( $posts as $post ) {