WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Mazinger
    Member
    Posted 2 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.

    http://wordpress.org/extend/plugins/most-and-least-read-posts-widget/

  2. whiletrue
    Member
    Plugin Author

    Posted 2 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

About this Topic