Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Hi all I am newbie to wordpress I am using the wp_list_categories in the sidebar to display the categories . How can i display thus categories sort by id any one much appreciated...

<?php wp_list_categories('exclude=73');?>
share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

wp_list_categories takes an orderby parameter which accepts :

  • ID - Default
  • name
  • slug
  • count
  • term_group

So the default behavior of wp-list-categories is to order by ID but you can specify that like so:

<?php wp_list_categories(array('exclude'=> 73,'orderby' => 'ID'));?>
share|improve this answer
    
I get this error Parse error: syntax error, unexpected '-', expecting '(' in /home/content/67/7399467/html/banas/wp-content/themes/Banas/sidebar.php on line 6 –  Fresher Dec 24 '12 at 15:37
    
<?php wp_list_categories(array('exclude'=> 73,'orderby' => 'ID'));?> and it's working thanks Much appreciated –  Fresher Dec 24 '12 at 15:48
    
opps, fixed it. –  Bainternet Dec 24 '12 at 15:49
    
Many thanks ,Without your help i did'nt solve that problem ... –  Fresher Dec 24 '12 at 15:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.