Created
February 22, 2013 21:33
-
-
Save billerickson/5016718 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Popular Posts | |
$args = array( | |
'meta_key' => 'be_stats', | |
'orderby' => 'meta_value_num', | |
'order' => 'ASC', | |
'posts_per_page' => 3, | |
'cat' => get_query_var( 'cat' ), | |
'post__not_in' => $used_posts, | |
); | |
$loop = new WP_Query( $args ); | |
if( $loop->have_posts() ): | |
echo '<div class="popular-posts-listing">'; | |
echo '<h4>Most Popular ' . $category->name . ' Posts</h4>'; | |
while( $loop->have_posts() ): $loop->the_post(); | |
echo '<div class="post">'; | |
if( has_post_thumbnail() ) | |
echo '<a href="' . get_permalink() . '">' . be_get_post_thumbnail( null, 134, 134, true ) . '</a>'; | |
echo '<h2><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>'; | |
echo wpautop( get_the_excerpt() . '…' ); | |
echo '<p class="more"><a href="' . get_permalink() . '" class="square-button">MORE</a></p>'; | |
echo '</div>'; | |
endwhile; | |
echo '</div>'; | |
endif; | |
wp_reset_postdata(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment