WordPress.org

Ready to get started?Download WordPress

Forums

WordPress Popular Posts
[resolved] Adding Commas to Single Post View Count? (2 posts)

  1. newyorkcity
    Member
    Posted 1 year ago #

    Right now I'm displaying the viewcount with <?php if (function_exists('wpp_get_views')) { echo wpp_get_views( get_the_ID() ); } ?>
    http://d.pr/i/FSAr

    I would like to add commas so that number could display as 65,821.. how do I do this?

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

  2. Héctor Cabrera
    Member
    Plugin Author

    Posted 1 year ago #

    Hi there,

    Try this:

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

    I will add this to the function in future releases so that it automatically outputs the views count with numeric format.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.