Custom Loop by custom taxonomy
-
Hey, so I used the code from another ticket to get my custom loop working, but I want to take it a step further by showing the top rated posts for each custom taxonomy under ‘types’ for the terms ‘Hotels’ and ‘Restaurants’. Can you please point me in the right direction or help me out with this. Thanks
My current code:
<?php if(function_exists('kk_star_ratings_get')) : $top_rated_posts = kk_star_ratings_get(10); endif; foreach($top_rated_posts as $post) { $post_id = $post->ID; $queried_post = get_post($post_id); ?> <div class="post-individual"> <div class="attachment-thumbnail"><?php echo get_the_post_thumbnail($post_id, (array(180, 160))); ?></div> <h3 class="post-title"><?php echo "<a href='".get_permalink($post_id)."'>".$queried_post->post_title."</a>"; ?></h3> <div class="post-content"> <?php $address = get_post_meta($post->ID, 'address', true); if (!empty($address)) { ?> <div class="listing"><img class="listing-icon" src="/wp-content/themes/EmptyCanvas/images/icons/icon-address.png" /> <?php echo $address; ?></div> <?php ; }?> <?php $phone = get_post_meta($post->ID, 'phone', true); if (!empty($phone)) { ?> <div class="listing"> <img class="listing-icon" src="/wp-content/themes/EmptyCanvas/images/icons/icon-phone.png" /> <?php echo $phone; ?></div> <?php ; }?> <?php $cuencahighlife_review = get_post_meta($post->ID, 'cuencahighlife_review', true); if (!empty($cuencahighlife_review)) { ?> <div class="listing"> <img class="listing-icon" src="/wp-content/themes/EmptyCanvas/images/icons/icon-review.png" /><a target="_blank" href="<?php echo $cuencahighlife_review; ?>"> CuencaHighLife's review of <?php the_title()?></a></div> <?php ; }?> <div style="float:right;"><?php echo kk_star_ratings(); ?></div> <h4><?php echo "<a href='".get_permalink($post_id)."'>More details</a>"; ?></h4> </div> </div> <img style="width: 690px; height: 2px; margin-left:10px;" src="/cuencahighlife/wp-content/themes/EmptyCanvas/images/line-seperator.png"/> <?php }?>
- The topic ‘Custom Loop by custom taxonomy’ is closed to new replies.