The latest, greatest version of WordPress was released yesterday. It comes with a whole lot fixes and new features. One of those new features is an admin bar similar to the one used on WordPress.com; however the admin bar only includes specific links rather than being automatically populated with all the various links that my install of WordPress has (from various plugins). I found the lack of those links for one particular plugin particularly annoying. A quick bit of research and a little bit later, I developed the Now-Reading Admin Bar Menu plugin.
I also noticed after the update that one of my client sites wasn’t working correctly. It turns out there’s a bug in WordPress 3.1 which breaks category exclusion. On my client’s site, I was using this code:
function exclude_category($query) { $cat_id = '-'.get_cat_id('meetings'); if ( $query->is_home ) { $query->set('cat', $cat_id); } return $query; } add_filter('pre_get_posts', 'exclude_category');
Fortunately that bug I linked to also includes a workaround. By changing the above bit of code to read as follows, I was able to fix my client’s site. ^_^
function exclude_category($query) { $cat_id = '-'.get_cat_id('meetings'); if ( $query->is_home ) { $query->set('category__not_in', array($cat_id)); } return $query; } add_filter('pre_get_posts', 'exclude_category');
Are you switching me over, great web guru?
Cath
Most humblest apologies oh great teller of tales, but I have not yet gotten to the switching over of your site. And it please you, I shall see about updating it over this coming weekend.
Me upgrading WordPress, a skit:
Me: (clicks button and waits ten seconds) That was it? Wow, that worked well.
The auto-updater tool in WordPress has worked well since around the first release after it was introduced. Still, it’s always good to backup your data & files first.
Thank you so much! I had been searching for a fix to this issue for quite a while and you had the fix! Much appreciation.
Glad to be of assistance.