• Resolved Ted Slater

    (@tedslater)


    Is it possible to show the number of total views on the site? So if you have 10 posts, and each post has 10 pageviews, it would show 100 total views.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Hector Cabrera

    (@hcabrera)

    Hey @tedslater, it’s been a while!

    Yes, you could do something like this:

    <?php
    global $wpdb;
    $total_views_count = $wpdb->get_var( "SELECT SUM(pageviews) FROM {$wpdb->prefix}popularpostsdata;" );
    echo "<p>Total views count is {$total_views_count}</p>";
    ?>
    Thread Starter Ted Slater

    (@tedslater)

    Sweet! I’ll give that a shot.

    So, when will you release a “Pro” version of this plugin, with additional features accessible through the WordPress dashboard? You know I’ll be your first paid customer. 🙂

    Plugin Author Hector Cabrera

    (@hcabrera)

    Well, I still have to sit down and make a list of stuff that would make good/desirable “pro” features first, then implement the ones that make the most sense for everyone, find/write a licensing system so I can sell license keys to people who might want those features, and only then I’ll be able to release that Pro version 😛 So yeah not anytime soon hahaha.

    Thread Starter Ted Slater

    (@tedslater)

    I get it. Thanks for the quick reply, Héctor. I appreciate the work you’ve put into this plugin, and for making it available to others at no cost.

    Thread Starter Ted Slater

    (@tedslater)

    That code worked perfectly. Thanks again, Héctor.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Show *all* pageviews’ is closed to new replies.