Hello!
I am having trouble organizing my categories by slug... any ideas?
Here is the code I am using:
[Code moderated as per the Forum Rules. Please use the pastebin]
I am thinking that this part is where the changes should be, but I am not sure:
<?php
/* collect categories */
foreach($posts as $post) :
$category = get_the_category('orderby=slug');
$cats[$category[0]->cat_ID] = $category[0]->cat_name;
endforeach;
/* uncomment next line to have categories sort alphabetically */
// uasort($cats, strcasecmp);
$cats = array_flip($cats);
?>
Thank you for your help!