getMostVisitedPostIDs not working?
-
Hello, first of thanks for this great plugin π
I’m trying to make my custom popular posts list by getting the array from getMostVisitedPostIDs. Here’s what I have so far:
<?php global $count_per_day; $valute = $count_per_day-> getMostVisitedPostIDs(7,1,true,true); $pquery = new WP_Query( array( 'post_type' => 'post', 'post__in' => $valute,'orderby' => 'count' ) ); if ( $pquery->have_posts() ) { echo '<ul>'; while ( $pquery->have_posts() ) { $pquery->the_post(); echo '<li>' . the_post_thumbnail('thumb-medium') . '</li>'; } echo '</ul>'; } else { // no posts found } ?>
I get the output but the listed items follow no order, also, changing the value of $limit to example 1 still displays all of my posts (I have only 3 for testing). Any tips or ideas? Cheers
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘getMostVisitedPostIDs not working?’ is closed to new replies.