Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $popularpost = new WP_Query( array( 'posts_per_page' => 8, 'meta_key' => 'wpb_post_views_count', 'orderby' => 'rand meta_value_num', 'order' => 'DESC' ) );
- while ( $popularpost->have_posts() ) : $popularpost->the_post(); ?>
- <div class="toppost">
- <a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
- <div class="posttitle">
- <?php
- $topposttitle = esc_html( get_the_title() );
- //echo $topposttitle;
- echo substr($topposttitle,0,20)."...";
- ?>
- </div>
- <div class="postthumb">
- <?php if ( has_post_thumbnail() ) {
- the_post_thumbnail('tpthumbs');
- //echo get_the_post_thumbnail(get_the_ID(), array(210,120,true));
- } ?>
- </div>
- </a>
- </div>
- <?php endwhile;
- ?>
Add Comment
Please, Sign In to add comment