slobizman
Member
Posted 1 year ago #
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]
slobizman
Member
Posted 1 year ago #
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;