Skip to content

Instantly share code, notes, and snippets.

@bipinmilan
Last active January 15, 2020 07:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bipinmilan/9a8a6e2707bb1e3b3a4f6b7173106489 to your computer and use it in GitHub Desktop.
Save bipinmilan/9a8a6e2707bb1e3b3a4f6b7173106489 to your computer and use it in GitHub Desktop.
<div class="popular_posts">
<h3 id="popular_heading">Popular Posts </h3>
<?php global $post;
$args = array( 'numberposts' => 5, 'offset'=> 1, 'category' => 1 );
$myposts = get_posts( $args );
foreach( $myposts as $post ) : setup_postdata($post); ?>
<div class="popular_thumbnail">
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail(); ?><br /><?php the_title(); ?></a>
<?php pp_setPostViews(get_the_ID()); echo pp_getPostViews(get_the_ID());; ?>
</div>
<?php endforeach; ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment