Deleting old category numbers (5 posts)

  1. desmondo
    Posted 9 years ago #

    Hi all,

    I mistakenly added categories and have since deleted them. I have gone into phpMyAdmin and deleted the entries out of the DB also, but now when I create a new category, it still insists on giving an ID after the last category I created.

    So, for eg, I only have one category (the default) which has an ID of 1. When I go to create a second category, it gives it an ID of 6, as the last category I added then deleted was 5. Anyone know how I can delete this out of this system and start with the one after default.

    Also in the sidebar, does anyone know how I can make the category list appear in ascending order of the ID's (so, #1, #2, etc). Currently, it seems to be going the other way.


  2. moshu
    Posted 9 years ago #

    1. Don't sweat it.. nobody cares about your cat IDs and to change the default behaviour of the database - it's much more trouble than it's worth.

    2. Depending on what template tag is used to display your categories - read about its parameters in the codex and apply whatever you need.

  3. desmondo
    Posted 9 years ago #

    Thanks for your reply Moshu, the first one is fine, I will stay with that, as for the second one though, I am still stuck. I have tried the following and neither seems to work:

    1. On the sidebar.php page, I have altered the code where it pulls in the categories and added "order_by=ID". So now it looks like:

    <?php wp_list_categories('order_by=ID&show_count=1&title_li=<h2>Categories</h2>'); ?>

    2. I have also tried to add this patch:

    from here (second last post):

    I really have no idea how to apply this patch, I have tried pasting the code into the pages it mentions and it just comes up with errors.

    Basically, I don't know what I'm doing and I'm stuck! Could someone please point me in the right direction.


  4. moshu
    Posted 9 years ago #

    Copying correctly it's an art :)
    order_by = WRONG
    orderby = CORRECT

  5. desmondo
    Posted 9 years ago #

    That's got it, posting correctly is an art too. :)


Topic Closed

This topic has been closed to new replies.

About this Topic