DebtCase profile

Home Forums DebtCase

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • DebtCase
    Participant

    The number field.

    Thanks

    DebtCase
    Participant

    Thanks for the response.

     

    I create the shortcode in functions.php:

     

    function wpb_user_count() {
    $usercount = count_users();
    $subscribers = $usercount[‘avail_roles’][‘subscriber’];
    return $subscribers;
    }
    add_shortcode(‘user_count’, ‘wpb_user_count’);

     

    Then add [user_count] into a Text Block and displays the correct number of subscribers.

     

    If I add the same [user_count] into a Counter element (whether in a column, section or directly onto the page) it just returns 0.

Viewing 2 posts - 1 through 2 (of 2 total)