• I need to organize my posts as ‘most read‘ using it for the amount of times the article / matter was visited and not based on the ‘number of comments’ post.
    I tried something like:

    <ul>
    <?php query_posts( "orderby=hits&showposts=3&order=desc"); ?>
    <?php  if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
      <li><a href="<?php the_permalink();?>"><?php the_title();?></a></li>
    <?php endwhile; else: endif;  wp_reset_query(); wp_reset_postdata(); ?>
    </ul>

    But this above code, which takes into account the ‘orderby = hits’ returns different results than me I see the administration (when I organize posts).
    How to solve this issue?

    https://www.ads-software.com/plugins/ajax-hits-counter/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How to list "Most Read Posts" with PHP in wordpress using AJAX Hits Counter?’ is closed to new replies.