/ Published in: PHP
WordPress top posts: custom post type / taxonomy Ordered by comment count
Expand |
Embed | Plain Text
global $blog_id; global $post; $termies = get_the_terms( $post->id, 'TAXONOMY_NAME' ); foreach( $termies as $term ) { $terms_slugs[] = $term->slug; // save the slugs in an array } 'post_type'=> 'POST_TYPE', 'taxonomy' => 'TAXONOMY_NAME', 'term' => $term->slug, 'orderby' => 'comment_count', 'showposts' => '5' ); query_posts( $query ); if (have_posts()) : while (have_posts()) : the_post(); echo '<div class="top-posts">'; echo '<li><a href="'; echo '" title="'; echo'"><div class="comment-img">'; echo '</div></a>'; echo '<a class="title" href="'; echo '" title="'; echo '">'; echo '</a>'; echo '<div class="author">'; echo '</div>'; endwhile; endif; wp_reset_query(); echo '</ul>'; echo '</div>';
Comments
Subscribe to comments
You need to login to post a comment.

WordPress - Top Posts in Custom Post Type / Taxonomy ordered by comment count
Complete college or university courses and receive your degree in web design. This will include knowledge of html coding, which is essential when designing websites. Also work at a web development company to become familiar with every aspect of the business. Thanks. Regards, professional translation services
Very useful post for me. It is exactly what I needed. Still can't believe that have found it. Thank you for providing me with WordPress top posts resume layout