WordPress.org

Ready to get started?Download WordPress

Forums

Social Count Plus
[resolved] Ad a comma to numbers (11 posts)

  1. fanbolero
    Member
    Posted 1 year ago #

    How can I add a comma to the social count numbers?
    For example, instead of 2000 this 2,000

    Thanks

    http://wordpress.org/extend/plugins/social-count-plus/

  2. Claudio Sanches
    Member
    Plugin Author

    Posted 1 year ago #

  3. fanbolero
    Member
    Posted 1 year ago #

    Thank you Claudio!
    What file (and line) on your plugin should I modify with the number_format function?

  4. Claudio Sanches
    Member
    Plugin Author

    Posted 1 year ago #

    In case it is not to change the plugin.
    And yes, it is possible to make a widget in your theme and use it.

    For this you can use the following functions:

    Twitter: <?php echo get_scp_twitter(); ?>
    Facebook: <?php echo get_scp_facebook(); ?>
    Posts: <?php echo get_scp_posts(); ?>
    Comments: <?php echo get_scp_comments(); ?>
    Widget: <?php echo get_scp_widget(); ?>

    However, I will release a new version of it today, with filters to be able to change the number format.

    And commenting here again showing you how to do this.

  5. fanbolero
    Member
    Posted 1 year ago #

    Thanks!! I will wait for it.

  6. Claudio Sanches
    Member
    Plugin Author

    Posted 1 year ago #

    Update the plugin to version 2.2 and and use this in your functions.php:

    https://gist.github.com/claudiosmweb/5424439

  7. fanbolero
    Member
    Posted 1 year ago #

    Thank you Claudio!!
    It works perfectly.

    A suggestion for a future release:
    I have a dark theme on my blog. I manually changed the color for the texts in your plugin on counter.css. It would be nice to have an option for selecting light/dark text color.

    Thanks again for the wonderful plugin.

  8. Claudio Sanches
    Member
    Plugin Author

    Posted 1 year ago #

    Noted here, the next version will add something.

  9. mdidesign
    Member
    Posted 1 year ago #

    Hello,

    does this functions.php code also work if I am just showing the numbers instead of the whole visual style? I am using the recent version of this great plugin and using this code in my functions.php - but there are still no comma or points. Still, for example, facebook shows 2687 followers instead 2.687 or similar. What am I doing wrong?

  10. mdidesign
    Member
    Posted 1 year ago #

    PS: I found the problem. Your solution works with shortcodes but unfortunately NOT with PHP-code. So when I include social counts with for example <?php echo get_scp_facebook(); ?> the comma does not show up. But when I use [scp code="facebook"] within a post - it works.

    But I would need it for PHP. Will there be a fix?

  11. Claudio Sanches
    Member
    Plugin Author

    Posted 1 year ago #

    I do not know if you know, but you can use PHP one time or another in their life.
    For example:

    <?php echo number_format( get_scp_facebook(), 0, '', ',' ); ?>

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.