exclude category will not work if using with featured sorting

Posted in: Newspaper
Post count: 30

case ‘featured’:
if (!empty($category_ids)) {
//for each category, get the object and compose the slug
$cat_id_array = explode (‘,’, $category_ids);

foreach ($cat_id_array as &$cat_id) {
$cat_id = trim($cat_id);

//get the category object
$td_tmp_cat_obj = get_category($cat_id);

//make the $args
if (empty($wp_query_args[‘category_name’])) {
$wp_query_args[‘category_name’] = $td_tmp_cat_obj->slug; //get by slug (we get the children categories too)
} else {
$wp_query_args[‘category_name’] .= ‘,’ . $td_tmp_cat_obj->slug; //get by slug (we get the children categories too)
}
unset($td_tmp_cat_obj);
}
}

this code will not work when specify exclude category id by prefixing minus sign, because get_category($cat_id) does not accept minus value

Post count: 6535

Hi

Thanks for reporting this, I’ve made some tests on mys side and got the same behavior. I’ve added this on our issue tracker and we will try to find a fix for it as soon a possible.
Thanks!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.