Most And Least Read Posts Widget
[resolved] how to show this in a post? (2 posts)

  1. Mazinger
    Posted 4 years ago #

    How to display the hits in a post

    I want the code that would look like that so I can display it anywhere:

    <?php total_hits(); ?>

    Please help.


  2. whiletrue
    Plugin Author

    Posted 4 years ago #

    Hi Mazinger,
    we did it in the new 1.7 release, with the "most_and_least_read_posts_get_hits" function. To make it more general, the function needs a post id as parameter and doesn't echo the hits directly.

    The code to use it in your template is like this:
    <?php echo most_and_least_read_posts_get_hits(get_the_ID()); ?>

    Thanks for your request!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Most And Least Read Posts Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic