WordPress.org

Support

Support » How-To and Troubleshooting » $query stopped working properly after upgrade to 3.1

$query stopped working properly after upgrade to 3.1

  • The following function (in Thesis, not that it matters) stopped working when I upgraded to 3.1. It is supposed to not show certain posts on the home page and other pages. Since the upgrade it now does. Any ideas as to what changed?

    [Code moderated as per the Forum Rules. Please use the pastebin]

Viewing 1 replies (of 1 total)
  • I figured it out. I’ll post the change for anyone else:

    if ($query->is_home ) {
         $query->set('category__not_in', array(226,317));
       } elseif ($query->is_paged ) {
          $query->set('category__not_in', array(226,317));
       } elseif ($query->is_search ) {
          $query->set('category__not_in', array(226));
       } elseif ($query->is_archive ) {
          $query->set('category__not_in', array(226));
       } elseif ($query->is_feed ) {
          $query->set('category__not_in', array(226));
       }
       return $query;
Viewing 1 replies (of 1 total)
  • The topic ‘$query stopped working properly after upgrade to 3.1’ is closed to new replies.