Fix for unwanted PHP notice on the frontend

A simplified version of the solution I posted on wordpress.org to removing a PHP notice.
http://wordpress.org/support/topic/unwanted-php-notice-on-the-frontend

It seems that $query isn't used, so no need to use php list.