roachfiend.com

  • firefox extensions
  • tutorials
  • faq
  • March 8, 2005

    Alphabetical hack in place

    Filed under: general — Eric @ 3:33 pm


    I finally figured out how to hack the categories to display in alphabetical order. The archives are untouched, so if for some reason you wanted to see them in chronological order, you can. If anyone else wanted to know how to do this, you modify the wp-includes/classes.php file. Go to line 462 (469 as of WP 1.5), and add in this:

    // Alphabetical hack for categories
    if ($whichcat)
    	{
        	$q['orderby'] = 'title';
        	$q['order'] = 'ASC';
    	}
    

    3 Responses to “Alphabetical hack in place”

    1. Duncan Says:

      Is this change used to affect the ordering of the categories on the front page (the listing on the right).

      Duncan.

    2. Eric Says:


      No, my category listing was alphabetical to begin with. This will only arrange the posts in alphabetical listing for each separate category. So, if you clicked on “Extensions”, the hack will sort them by name instead of post date.


    3. Bebo Says:

      !!!!!