Taxonomy Images
[resolved] How to change order of taxonomies on the page? (2 posts)

  1. andyy
    Posted 4 years ago #

    Is it possible to order the taxonomies, by their ID or perhaps even more usefully by Description?

    $cats = get_categories('taxonomy=my_taxonomy_category');
    foreach ( $cats as $c ) {
    $url = get_category_link( $c->term_id );
    echo '<h2>name . '" >'.$c->name.'</h2>';
        $img = $taxonomy_images_plugin->get_image_html( 'thumbnail', $c->term_taxonomy_id );
        if( !empty( $img ) )
            print '' . $img . '';
  2. andyy
    Posted 4 years ago #

    After thinking about it, I realised this is nothing to do with this plugin. I found a way to sort the category array by its description field, so I can now give that field a number to define its category order.

    function sortStdArray($cats,$index){
     for ($i=0; isset($cats[$i]); $i++)
     $sort[$i]= $cats[$i]->{$index};
     foreach($sort as $k=>$v)
     return $return;
     $cats = sortStdArray($cats,"description");

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Taxonomy Images
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic