• Hello,

    I am trying to find a way to do the following :

    I have multiple departments, a team of persons, each attached to one dept. The number AND ORDER of departments are likely to evolve in the future.

    I want to use categories for the departments : direction; sales; etc… all under the DEPARTMENTS category Wich means I need to be able to REORDER them if needed. I thought this plug in could offer what I wanted… but i can’t seem to be able to use it the way I want.

    The team is currently shown on the DEPARTMENTS category ‘page’ using the following code :

    global $ancestor;
    $childcats = get_categories('child_of=' . $cat . '&hide_empty=1');
    foreach ($childcats as $childcat) {
    	echo '<h2>'.category_description($childcat->cat_ID).'</h2>';
      if (cat_is_ancestor_of($ancestor, $childcat->cat_ID) == false){
    query_posts(array ( 'order' => 'asc', 'category__in' => array($childcat->cat_ID),'orderby' => 'meta_value', 'meta_key' => 'classement_equipe' ));
    	if (have_posts()) : while (have_posts()) : the_post();
    	echo '<div class="featured-thumbnail">'; the_post_thumbnail(); echo '</div>';
    	the_content(__('[+]'));
    	endwhile; else:
    	echo 'error';
    	endif;

    When I change the category order, it doesnt affect this code… Any idea on how to do it ?

    (Note that I am totally open to other ways to achieve this)

    Thanks
    PY.

Viewing 1 replies (of 1 total)
  • Plugin Author froman118

    (@froman118)

    Try changing the second line to this:

    $childcats = get_categories('orderby=order&child_of=' . $cat . '&hide_empty=1');

    As far as I can tell that will get it ordering correctly.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin : My Category Order] How to use without 'wp_list_categories'’ is closed to new replies.