diff --git a/includes/class-displayfeaturedimagegenesis-common.php b/includes/class-displayfeaturedimagegenesis-common.php index 939a0c8..81efb87 100644 --- a/includes/class-displayfeaturedimagegenesis-common.php +++ b/includes/class-displayfeaturedimagegenesis-common.php @@ -60,7 +60,7 @@ class Display_Featured_Image_Genesis_Common { $image_id = $postspage_image; } // taxonomy - elseif ( is_category() || is_tax() ) { + elseif ( is_category() || is_tag() || is_tax() ) { $term = get_queried_object(); $t_id = $term->term_id; $term_meta = get_option( "taxonomy_$t_id" ); @@ -73,9 +73,8 @@ class Display_Featured_Image_Genesis_Common { } elseif ( ! has_post_thumbnail() || $width <= $item->medium ) { $taxonomies = get_taxonomies(); - $args = array( 'orderby' => 'term_group', 'order' => 'ASC' ); + $args = array( 'orderby' => 'count', 'order' => 'ASC' ); $terms = wp_get_object_terms( get_the_ID(), $taxonomies, $args ); - usort( $terms, array( __CLASS__, 'tax_term_compare' ) ); foreach ( $terms as $term ) { $t_id = $term->term_id; @@ -156,20 +155,6 @@ class Display_Featured_Image_Genesis_Common { } - /** - * compare multiple taxonomies - * @param taxonomy $a each taxonomy assigned to a post - * @param name $b the slug of each taxonomy - * @return list list of terms, ordered by taxonomy, then slug - * @since x.y.z - */ - protected static function tax_term_compare( $a, $b ) { - if ( $a->taxonomy == $b->name ) { - return ( $a->taxonomy < $b->name ) ? -1 : 1; - } - return ( $a->taxonomy < $b->name ) ? -1 : 1; - } - /** * Get the ID of each image dynamically.