Alternative for Just One Category plugin for 3.1
-
Since Just One Category isn’t working on 3.1 I searched for a solution.
Here you’ll find a workaround to exclude child posts from parent categories. I deactivated Just One Category, made the changes to archive.php as mentioned in the link below and upgraded. Now things are working again.
Before your category archive loop
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $current_cat = get_query_var('cat'); $args=array( 'category__in' => array($current_cat), 'paged' => $paged ); query_posts($args); ?>
After category loop
<?php set_query_var("cat",$current_cat); ?>
Source: https://www.kristarella.com/2010/03/wordpress-exclude-child-categories-from-category-archives/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Alternative for Just One Category plugin for 3.1’ is closed to new replies.