WordPress.org

Ready to get started?Download WordPress

Forums

Deleting old category numbers (5 posts)

  1. desmondo
    Member
    Posted 7 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.

    Cheers

  2. moshu
    Member
    Posted 7 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
    Member
    Posted 7 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:
    http://trac.wordpress.org/attachment/ticket/4335/cat_id_order__branches_2.2.diff?format=txt

    from here (second last post):
    http://nslog.com/2007/05/25/wordpress_22_changes_category_order_behavior

    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.

    Cheers

  4. moshu
    Member
    Posted 7 years ago #

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

  5. desmondo
    Member
    Posted 7 years ago #

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

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags