Support » Plugin: Post Views Counter » How to display most viewed posts on another page

  • Hello. I’m used you plugin and I have post views in admin panel. I want to add new page on the site and display post list with all most viewed posts. How can I do this?

Viewing 1 replies (of 1 total)
  • Thread Starter bugsbunnny

    (@bugsbunnny)

    <ul>
        <?php
            global $post;
            $args = array(
            	'order'	=> 'DESC',
            	'suppress_filters' => false,
            	'orderby' => 'post_views'
            );
            $most_viewed = get_posts( $args );
            foreach( $most_viewed as $post ){ setup_postdata($post);
    	?>
    	
    	<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
    	
    	
    	<?php }
        wp_reset_postdata();
        ?>
    </ul>

    I read docs and this code help me do this.
    And I have one more question how I can add one more
    I need to display posts who have more views than 1000

Viewing 1 replies (of 1 total)
  • The topic ‘How to display most viewed posts on another page’ is closed to new replies.