Switched query attribute from "name" to "pagename"
Added empty check for wp_query->query to suppress warnings on the home page
Merge pull request #5 from alexciarlillo/master

fixed wordpress plugin for 3.5.1.