WordPress.org

Forums

WordPress Popular Posts
[resolved] [possibly bug] wpp_get_views treats the "all" parameter like the "daily" (6 posts)

  1. Vahid
    Member
    Posted 1 year ago #

    When I use the following code in the loop, it shows only the last 24 hours views. In other words, the wpp_get_views treats the "all" parameter like the "daily" parameter. Is this a bug or I'm doing something wrong?

    <?php if (function_exists('wpp_get_views')) { echo wpp_get_views($post->ID, 'all' ); } ?>

    It should be mentioned that the "daily", "weekly", and "monthly" parameters works perfectly.

    http://wordpress.org/plugins/wordpress-popular-posts/

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Vahid,

    I'll take a look into it and reply back as soon as possible.

  3. Vahid
    Member
    Posted 1 year ago #

    Just to mention that I'm still awaiting the solution:-)
    Thanks Héctor.

  4. Vahid
    Member
    Posted 12 months ago #

    Just to remember that I'm still awaiting the solution:-)
    Thanks Héctor.

  5. Héctor Cabrera
    Member
    Plugin Author

    Posted 12 months ago #

    Oh my God, I completely forgot about this! I'm so sorry for taking so long to reply, Vahid!

    You were right: it's a bug. A proper fix will be available on the next version of the plugin.

    Quick workaround, for now:

    <?php
    if (function_exists('wpp_get_views')) {
        // Without the range parameter, the function will retrieve the All-times views count by default
        echo wpp_get_views($post->ID);
    }
    ?>
  6. rei15
    Member
    Posted 9 months ago #

    <?php
    if (function_exists('wpp_get_views')) {
      echo wpp_get_views( get_the_ID() );
    }
    ?>

    This has not been fixed, it's still showing only the views for the past 24 hours and not all.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WordPress Popular Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic