Just One Category für WordPress 3.1
Seit dem Update auf WordPress 3.2.1 funktioniert das Plugin auch mit diesem Hotfix nicht mehr. Ich habe im Moment aber weder Zeit und noch größeres persönliches Interesse das Problem zu beheben. Tut mir Leid.
The Plugin with hotfix doesn’t work with WordPress 3.2.1 and I have not time and interest to solve the new problem. Sorry.
Hier eine WordPress 3.1 kompatible Version von Just One Category. That’s a new version of the plug-in Just One Category, working with WordPress 3.1.
Ich hoffe mdawaffe übernimmt es in das offizielle Projekt, so dass andere User das Plugin automatisiert updaten können. I hope mdawaffe will put it on the wordpress-website for easy updating.
Geänderter Teil von / Changed part of just-one-category/just_one_cat.php:
function where( $where ) {
global $wpdb;
remove_action( 'posts_where', array( &$this, 'where' ) );
$term_id = rtrim( $this->q->get( 'cat' ), ' /' );
if ( !is_numeric( $term_id ) || $term_id < 1 )
return $where;
$term_taxonomy_id = get_term( $term_id, 'category' )->term_taxonomy_id;
$where = preg_replace('#AND\s*\(\s*wp_term_relationships.term_taxonomy_id\s*IN\s*\(\d+(,\d+)*\)\s*\)#','AND ( wp_term_relationships.term_taxonomy_id IN ('.$term_taxonomy_id.') )',$where,1);
return $where;
}
Hey, wenn Du zu wenig Zeit hast, würde ich Dir gerne helfen, wenn ich kann :)
Nur zu Zwenny. Da ich das Plugin selber nicht mehr benötige, will ich auch keine Zeit mehr investieren, um einen weiteren Fixes zu schreiben. Du würdest damit also weniger mir als anderen WordPress-Nutzern helfen, die das Plugin gerne verwenden würden, wenn du ein Fix schreibst.
It does not seem to work for me either – on WordPress 3.2.1. All the subcategory posts are still showing up in the parent categories. And I did make sure the plugin was reactivated, and I have no other plugins on this site that affect categories in any way.
I can reproduce the problem. There is a problem with Just One Category and the WordPress Update again. But actuality I have no time and interest to fix it. Sorry.
Any chance of this update being included in an official plugin that we can simply download and install from WordPress itself?
I wrote an email to the author, a month ago. But mdawaffe didn’t answer or react yet.
This fix does stop the 404 error on category pages, but (at least in my testing) does not exclude the child categories from the parent category pages, which is what we need from the plugin. Am I missing a step?
(And sorry my German is not good enough to ask this question in your language!)
As you can see on my category page “Fotografie”, the fix works on my blog. How ever it doesn’t correct the post-counter for the categories, but the original plugin didn’t correct this either.
Maybe you replaced the full plugin with the new code instead of the function where() only?
Yesterday I tested the fix on a second blog and it works well. But I got a second idea that’s the problem: Maybe the plugin got deactivated automatically by wordpress, during the installation of the fix?
I will have to do some more testing. I think I’ve covered both of your suggestions, but something is still not working. Let me report back if I can get more details.
Next idea: Some plugins don’t work together. For example “Ultimate Category Excluder” isn’t compatible to “Just one category” with 3.1-fix.
For explanation: I deactivated Just one Categorie on my blog caused by a reorganization.