Title: reordering categories ?
Last modified: August 18, 2016

---

# reordering categories ?

 *  [chuckblue](https://wordpress.org/support/users/chuckblue/)
 * (@chuckblue)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/)
 * Searched and couldn’t find anything.
 * They are presently ordered by ID number, I want to reorder them alphabetically.
 * [http://wargame.drivein-jim.net/](http://wargame.drivein-jim.net/)
 * Is there an easy way to do this ?
 * Thanks

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/reordering-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/reordering-categories/page/2/?output_format=md)

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/#post-133741)
 * Look at the ‘sort_column’ parameter:
 * [http://codex.wordpress.org/Template_Tags/list_cats](http://codex.wordpress.org/Template_Tags/list_cats)
   
   [http://codex.wordpress.org/Template_Tags/wp_list_cats](http://codex.wordpress.org/Template_Tags/wp_list_cats)
 *  Thread Starter [chuckblue](https://wordpress.org/support/users/chuckblue/)
 * (@chuckblue)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/#post-133743)
 * Hmm. Wouldn’t sort_column be it ? that sorts on ID or name.
 * and set sort_order to ‘desc’ would get it alphabetized ?
 * I’m not a php/database person.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/#post-133744)
 * You jumped the gun on my edit. `;)` Just set ‘sort_column’ to name.
 *  Thread Starter [chuckblue](https://wordpress.org/support/users/chuckblue/)
 * (@chuckblue)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/#post-133746)
 * No problem.
 * As tired as I am, I’m surprised I caught it at all.
 * edit:
 * I couldn’t find list_cats in index.php, and there isn’t a templte.php
 * Where is it ?
 * I’m using 1.2
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/#post-133747)
 * No wp_list_cats either?
 * Shouldn’t be too far down from `<div id="menu">`, towards the end of index.php.
 *  Thread Starter [chuckblue](https://wordpress.org/support/users/chuckblue/)
 * (@chuckblue)
 * [21 years, 7 months ago](https://wordpress.org/support/topic/reordering-categories/#post-133748)
 * got wp_list_cats();
 * edit: got it.
 * added ‘sort_column=name’ in the () above.
 * works now.
 *  [davincim](https://wordpress.org/support/users/davincim/)
 * (@davincim)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134674)
 * I’m trying to piece this together, but I’m missing something.
 * I reviewed both links in the codex referenced above, but I don’t understand how
   to implement the parameters.
 * What I’m wanting to do is:
 * a) sort my category list alphabetically
    b) have the number of posts within each
   category appear in ( )’s next to the category name
 * I’ve tried:
 * `<?php list_cats(); ?>` and,
 * `<?php list_cats(FALSE, ' ', 'name'); ?>;` and,
 * `<?php wp_list_cats('arguments'); ?>`
 * all of which are examples in the codex. The results: no change. I made the changes
   in my sidebar.php. I’m using WP v1.5.
 * Any help is very much appreciated. 🙂
 *  [oriecat](https://wordpress.org/support/users/oriecat/)
 * (@oriecat)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134675)
 * I’ve got mine in alpha and showing the # of posts (I’m also excluding 2, so you
   would need to get rid of that part).
 * Mine says:
    <?php wp_list_cats(‘sort_column=name&optioncount=1&exclude=8,10’);?
   >
 *  [davincim](https://wordpress.org/support/users/davincim/)
 * (@davincim)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134676)
 * Thanks, oriecat. So I entered
 * `<?php wp_list_cats('sort_column=name&optioncount=1'); ?>`
 * into my sidebar taking into account the exlusion part and it’s still having no
   affect.
 * Two things:
    1. According to the codex ([http://codex.wordpress.org/Template_Tags/wp_list_cats](http://codex.wordpress.org/Template_Tags/wp_list_cats))
   it defines “optioncount” as not displaying the count of posts in each category.
   So could you help me understand what the value you had in there (1) does?
 * 2. I didn’t have this problem with Kubrick; I noticed it when I changed to Blix.
   I’m not blaming Blix, just pointing this out in case it might spark an idea for
   anyone reading this. Maybe it’s doing something that’s different than the way
   Kubrick is doing it. Just guessing, but inexperienced with php as I am, I don’t
   see things the way a php expert might see them (yet). 😉
 * Here’s my test blog where I’m trying things out: [http://familywebwatch.com/blog_test/](http://familywebwatch.com/blog_test/)
 * EDIT: Oh and btw, did try `<?php wp_list_cats('sort_column=name'); ?>`, but no
   change either. 🙁
 *  [oriecat](https://wordpress.org/support/users/oriecat/)
 * (@oriecat)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134677)
 * On question 1, the default behavior for the optioncount is off, or zero, so the
   1 is to turn it on.
 * I just copied my code directly from the first example on the wp_list_cats codex
   page, changing my excludes. It seems very strange that it wouldn’t work for you!
   I don’t know if it would make a difference, but it does show it enclosed in ul
   tags (and mine is too) did you do that?
 *  [davincim](https://wordpress.org/support/users/davincim/)
 * (@davincim)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134678)
 * Strange indeed. The code in my sidebar.php is
 * `
    <h2><em>Posts by Category</em></h2> <ul class="categories"> <?php wp_list_cats('
   sort_column=name'); ?> </ul>
 * If I understand your last question correctly, the code is within ul tags. Could
   it be that there are no li tags in the code above?
 * `
    <h2><em>Categories</em></h2> <ul class="categories"> <li><a href="http://familywebwatch.
   com/blog_test/category/general/" title="View all posts filed under General">General
   </a></li> <li><a href="http://familywebwatch.com/blog_test/category/parents/"
   title="View all posts filed under Parents">Parents</a></li> <li><a href="http://
   familywebwatch.com/blog_test/category/teens/" title="View all posts filed under
   Teens">Teens</a></li> <li><a href="http://familywebwatch.com/blog_test/category/
   sexual-predators/" title="View all posts filed under Sexual Predators">Sexual
   Predators</a></li> <li><a href="http://familywebwatch.com/blog_test/category/
   identity-theft/" title="View all posts filed under Identity Theft">Identity Theft
   </a></li> <li><a href="http://familywebwatch.com/blog_test/category/netiquette/"
   title="View all posts filed under Netiquette">Netiquette</a></li> <li><a href
   ="http://familywebwatch.com/blog_test/category/internet-safety/" title="View 
   all posts filed under Internet Safety">Internet Safety</a></li> <li><a href="
   http://familywebwatch.com/blog_test/category/kids/" title="View all posts filed
   under Kids">Kids</a> </li> </ul>
 *  [oriecat](https://wordpress.org/support/users/oriecat/)
 * (@oriecat)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134679)
 * The li’s are added by the tag itself.
 * I dunno 🙁 What if you remove your class=categories, so it is just the ul? I’m
   grasping here
 *  [davepar](https://wordpress.org/support/users/davepar/)
 * (@davepar)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134680)
 * I believe it’s a bug. Check out this post: [http://wordpress.org/support/topic.php?id=28667#post-161194](http://wordpress.org/support/topic.php?id=28667#post-161194).
 *  [davincim](https://wordpress.org/support/users/davincim/)
 * (@davincim)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134681)
 * Man, this is frustrating. 🙁 I tried removing the class=categories, but no change.
 * I’m grasping, too, but I’m wondering if this has something to do with “Pages”
   not working either. I could create pages with no problem, but they just wouldn’t
   show up in the “Pages” section in my sidebar. I was pointed to [http://mosquito.wordpress.org/bug_view_advanced_page.php?bug_id=927](http://mosquito.wordpress.org/bug_view_advanced_page.php?bug_id=927)
   where it describes this in more detail. I haven’t tried making the change it 
   suggests, and I can’t say for sure that it’s even related. However, I’m good 
   at brainstorming. 😉
 * Thanks again for your help, oriecat. If you have any other suggestions, I’m open
   to them, but I’ll keep plugging away at it and post back if I find anything new.
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [21 years, 4 months ago](https://wordpress.org/support/topic/reordering-categories/#post-134682)
 * Download this file:
 * [http://trac.wordpress.org/file/trunk/wp-includes/template-functions-category.php?rev=2450&format=raw](http://trac.wordpress.org/file/trunk/wp-includes/template-functions-category.php?rev=2450&format=raw)
 * Use it to replace the one in your wp-includes/ directory. Until you do, there’s
   no way to know if the problem you’re having is not due to the bug in the original
   1.5 release.

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/reordering-categories/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/reordering-categories/page/2/?output_format=md)

The topic ‘reordering categories ?’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 21 replies
 * 6 participants
 * Last reply from: [mkgago](https://wordpress.org/support/users/mkgago/)
 * Last activity: [21 years, 2 months ago](https://wordpress.org/support/topic/reordering-categories/page/2/#post-134700)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
