Create Topic

WP Tavern Forums Create Topic

Create New Topic

M.K. Safi

Many people were using the following code to exclude certain categories from appearing on their homepage


function exclude_category($query) {
if ( $query->is_home ) {
$query->set('cat', '-xx');
}
return $query;
}
add_filter('pre_get_posts', 'exclude_category');

A bug in a fairly recent WordPress update broke this (completely valid) code for everybody.

If a Chrome update breaks something, it’s an annoyance, maybe. But if a WordPress update fails, at best it’s a public embarrassment and at worst a disaster.

If automatic updates is a must, then make sure a lot of people try the update safely on actual production sites before pushing the update out to everyone else…






Newsletter

Subscribe Via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.