Calling a wp_query $posts causes a 500 error

Is $posts a reserved variable

Yes, it is, $posts is the global variable which holds the array of posts from the main query. This is how it is set:

$GLOBALS['posts'] = & $wp_query->posts;

Just remember, $posts === $GLOBALS['posts']

Leave a Comment