WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. turnkey13
    Member
    Posted 1 year 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 1 year ago #

    I need the same, please!!!

  3. turnkey13
    Member
    Posted 1 year 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 1 year 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. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year 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

About this Topic