WordPress.org

Forums

WordPress Popular Posts
[resolved] Manually editing counter (5 posts)

  1. turnkey13
    Member
    Posted 2 years ago #

    hello,

    probably the most efficient popular plugin.

    How can I add extra static number to post stat while showing them, I don't want to show low stats, I mean I would like start counter from certain number like 30 for example :)

    thanks..

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

  2. gerzok
    Member
    Posted 2 years ago #

    I need the same, please!!!

  3. turnkey13
    Member
    Posted 2 years ago #

    I edited the output like below, and it works..

    <?php if (function_exists('wpp_get_views')) {

    $var1 = 100;
    $var2 = 1000;

    $views = wpp_get_views( get_the_ID() );

    if ($views <= 100)
    {
    $viewsx1 = $var1 + $views ;
    echo $viewsx1;
    }
    else
    {
    $viewsx2 = $var2 + $views ;
    echo $viewsx2;
    }

    ?>

  4. jpanizzoli
    Member
    Posted 2 years ago #

    Where did you place this code? I'd like to do something similar and alter the page view counts. Tried adding it to my template (with the WPPP code) but it didn't work...

  5. Hector Cabrera
    Member
    Plugin Author

    Posted 2 years ago #

    That code can be used anywhere on your theme. The wpp_get_views template tag retrieves the views count for any post or page.

    I believe he's using that code within The Loop (or a custom loop).

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