WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Vahid
    Member
    Posted 10 months 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 10 months ago #

    Hi Vahid,

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

  3. Vahid
    Member
    Posted 9 months ago #

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

  4. Vahid
    Member
    Posted 3 months ago #

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

  5. Héctor Cabrera
    Member
    Plugin Author

    Posted 3 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 1 month 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.

Reply

You must log in to post.

About this Plugin

About this Topic