Category Order
-
Have a weird issue with the category order and have looked for an answer but this has me stumped. I have the latest versions of WP and hueman theme and have a child theme setup with this in my functions.php file to reverse the post order so the parent category shows first:
`function reverse_categories($terms, $id, $taxonomy){
if($taxonomy == ‘category’){
$terms = array_reverse($terms, true);
}
return $terms;
}
add_filter(‘get_the_terms’, ‘reverse_categories’, 10, 3);’The site in question is https://airmaxxx.com/
You’ll notice the posts have 4 categories; air compressors, air tanks, air valves and air bags. They all have air ride suspensions as their parent category but only compressors and bags are displaying correctly. If I take out the code in my functions.php then only the tanks and valves display correctly. The problem is with the categories for air tanks and air valves. If I setup a new category they are displayed correctly (with the code in functions). I’ve deleted all categories and started from scratch numerous times to no avail. It’s not a caching issue nor do I have anything else customized for the categories. Any help would be greatly appreciated!!
Thanks in advance!
Ken
- The topic ‘Category Order’ is closed to new replies.