Forums

[resolved] Sort categories listed in a special page (2 posts)

  1. alissonj
    Member
    Posted 1 year ago #

    Hi guys,

    I using some sort of gallery page that lists all the categories (and sub categories) that i have. It works flawlessly except that i'm not being able to sort the order of categories :(

    They are sorted by name now, but i would like them to be sorted by cat_id (as this is how i have them sorted in admin)

    Here's a part of code that lists my categories, i would appreciate if anyone could help me out with that small trouble:

    <?php 
    
    	    $catQuery =  get_categories('include=9999999' . get_inc_categories("cat_exclude_") .'');
    		$catCounter = 0;
    		foreach ($catQuery as $category) {
    		$catCounter++;
    		$catLink = get_category_link($category->cat_id);
    
    		echo  '<a name="' . $category->name. '"></a><h4>' .$category->name.'</h4>';
    			echo '<ul class="gallerylist">';
    
    			query_posts('cat='.$category->term_id.'&showposts=5');?>
  2. Mark / t31os
    Moderator
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Topic