• Is there a way to just show one total number of followers for all of the accounts combined? I think this would be an awesome option if it isn’t already.

    Thanks, Jared

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Claudio Sanches

    (@claudiosanches)

    You can use the functions that you can found in “Shortcodes and Functions” tab to sum all results and then display it on your website.
    But don’t seems properly have an icon for it by default in this plugin.

    Thread Starter jaredthequad

    (@jaredthequad)

    I’m not sure exactly what shortcode to use to sum up all accounts into one number. I tried the following.

    [scp code=”comments,facebook,twitter,youtube”]

    But that didn’t work. Can you tell me what I’m doing wrong?

    Thanks, Jared

    Plugin Author Claudio Sanches

    (@claudiosanches)

    I’m saying to use the functions.

    Like for example, display the sum of Facebook and Twitter followers:

    echo get_scp_counter( 'facebook' ) + get_scp_counter( 'twitter' );
    

    But I just remembered that you can show the count of all counters at the same time using:

    echo array_sum( get_scp_all() );
    
    Thread Starter jaredthequad

    (@jaredthequad)

    That worked perfectly! Thanks so much.

    I noticed that it’s not adding any commas to the numbers. Like 15000 instead of 15,ooo. Is there a way to add this?

    Also, I have a fairly large email list and since there’s no Mailchimp way to add it. Can I add the number manually any way?

    I greatly appreciate your quick and helpful responses.

    Plugin Author Claudio Sanches

    (@claudiosanches)

    I noticed that it’s not adding any commas to the numbers. Like 15000 instead of 15,ooo. Is there a way to add this?

    You can change how display it using the social_count_plus_number_format for the widget:

    
    function my_custom_scp_number_format( $total ) {
        return number_format( $total, 0, '', ',' );
    }
    
    add_filter( 'social_count_plus_number_format', 'my_custom_scp_number_format' );
    

    And you can use the same function while displaying the total, of course:

    echo my_custom_scp_number_format( array_sum( get_scp_all() ) );
    

    Also, I have a fairly large email list and since there’s no Mailchimp way to add it. Can I add the number manually any way?

    I’m looking for include a Mailchimp integration in this plugin soon. But of course, you can include manually too, bot I have plans to try implement it before November.

    Thread Starter jaredthequad

    (@jaredthequad)

    Thanks so much for your help.

    I found this on your github which is similar to what you want me to do. But I can’t seem to find where to put the “social_count_plus_number_format” filter.

    How can I round numbers?

    It’s possible to round numbers using the social_count_plus_number_format filter.

    Example of rounding 1500 to 1.5K or 1000000 to 1M:

    function my_custom_scp_number_format( $total ) {
    if ( $total > 1000000 ) {
    return round( $total / 1000000, 1 ) . ‘M’;
    } else if ( $total > 1000 ) {
    return round( $total / 1000, 1 ) . ‘K’;
    }

    return $total;
    }

    add_filter( ‘social_count_plus_number_format’, ‘my_custom_scp_number_format’ );

    Thread Starter jaredthequad

    (@jaredthequad)

    Scratch that. I figured out how to add the comma!

    But I’m still having an issue adding my custom mailchimp number to my total. Can you maybe point me to an old support post or anywhere with an example?

    Thanks so much Claudio!

    Plugin Author Claudio Sanches

    (@claudiosanches)

    I don’t have any post about it yet.
    To be honest, I have no idea how to fetch this data yet using the MailChimp REST API.
    Next week I have plans to start study the REST API and start this integration.

    Thread Starter jaredthequad

    (@jaredthequad)

    Ha no problem.

    You mentioned there’s a way to manually add to the total number.

    Would it be done in the code like this?

    echo my_custom_scp_number_format( array_sum( get_scp_all() ) + ( ‘5000’ ));

    Plugin Author Claudio Sanches

    (@claudiosanches)

    Yes, this code works too, if you have the total of MailChimp subscribers ??
    But I has think that you are asking of how to fetch it from the MailChimp REST API xD

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Show single cumulative number?’ is closed to new replies.