How to order my Categories by ID instead of Name
-
I know there are a million posts of the same topic, but since everyone’s themes are coded differently, I haven’t been able to find the answer to my problem.
My theme is listing my categories in alphabetical order because that’s the default. I’ve gone into the editor to see where I can change “name” to “id” but there isn’t any code in there for it.
I don’t know what to add to make it work. I’ve seen many solutions use the $arg line of code, and I don’t see that anywhere, so maybe that’s the problem.
Can someone tell me what to add? Thank you ??
<?php /* translators: used between list items, there is a space after the comma */ $categories_list = get_the_category_list( __( ' // ', 'twentyeleven' ) ); /* translators: used between list items, there is a space after the comma */ $tag_list = get_the_tag_list( '', __( ', ', 'twentyeleven' ) ); if ( '' != $tag_list ) { } elseif ( '' != $categories_list ) { $utility_text = __( '<span style="font-family: Crimson Text, serif; font-style: italic; font-size: 16px;" class="entry-utility-prep entry-utility-prep-cat-links">Posted in: </span> %1$s', 'twentyeleven' ); } printf( $utility_text, $categories_list, $tag_list, esc_url( get_permalink() ), the_title_attribute( 'echo=0' ), get_the_author(), esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ) ); ?>
`
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘How to order my Categories by ID instead of Name’ is closed to new replies.