Support » Themes and Templates » Organize Categories by Slug

  • 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:

    /* collect categories */
      foreach($posts as $post) :
                $category = get_the_category('orderby=slug');
                $cats[$category[0]->cat_ID] = $category[0]->cat_name;
    /* uncomment next line to have categories sort alphabetically */
    //    uasort($cats, strcasecmp);
        $cats = array_flip($cats);

    Thank you for your help!

  • The topic ‘Organize Categories by Slug’ is closed to new replies.