Instead of trying to change ID’s around (you can’t, it would be a massive pain in the arse, so don’t try), WordPress has several functions to allow you to work with categories and such by name instead of by ID.
For example, to get the ID of a category named “General”:
$id = get_cat_ID('General');
Or if you need to get a page using it’s title:
$page = get_page_by_title('Some Title')
echo $page->ID;
And you can always do stuff directly if you need to:
$title = 'Some Title';
$post_id = $wpdb->get_var( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_title = %s", $title) )
Use tricks like that to get the info you need to get. Or whatever, sometimes you don’t even need the ID if you use the alternative functions to get by title/slug/etc.
Thanks Otto,
That’s a much much better idea 🙂
Very much appreciated.
where i need to paste this code?
thanks
da
What I found the easiest is just changing the category’s slug, and sort the categories based on the slugs. You have full control over your slugs, so you can for instance start all of them with a number – for ordering purposes 🙂
Then just add/change your template’s sidebar.php (or wherever else you want to list your catelories) to:
<?php wp_list_categories(‘orderby=slug’); ?>.
Perhaps with some other parameters.
More about listing categories in WP on http://codex.wordpress.org/Template_Tags/wp_list_categories.