I am trying to create a list of categories ordered by id, the description and all posts in the categories. Here is the code: http://pastebin.com/9XeeTW4m and my page: http://www.allenwebcreation.com/public_html/wp/research-our-collections2/.
How do I change the code so that the categories are ordered by id instead of alphabetically?
Thanks!
http://codex.wordpress.org/Function_Reference/get_categories
use the 'orderby' and 'order' parameter;
try to change (line 10):
foreach( get_categories('hide_empty=false&exclude=1,7,15,26&orderby=id&order=asc') as $cat ) :
and (line 23):
$next = get_categories('hide_empty=false&parent=' . $cat . '&orderby=id&order=asc');
hope it works; good luck ;-)
Thanks alchymyth, that did the trick!