Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Display Member Count

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Display Member Count

  • This topic has 11 replies, 4 voices, and was last updated 11 years, 8 months ago by admin.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • February 26, 2011 at 2:09 am #2816
    derixc
    Member

    Hi again.

    Is there a shortcode or php code to display the current number of members?

    February 27, 2011 at 12:25 am #29522
    amin007
    Participant

    There is no shortcode but you can use the following code to retrieve the total member count

    global $wpdb;
    $members_table_name = $wpdb->prefix . "wp_eMember_members_tbl";
    $wp_member_count = $wpdb->get_row("SELECT count(*) as count FROM $members_table_name");
    $total_number_of_members = $wp_member_count->count;

    February 27, 2011 at 3:31 am #29523
    derixc
    Member

    Thank you for providing me these codes though I’m not quite sure how to use it but do you think there is a good chance of having it up in the future?

    I think it adds more credibility to the site if they know how many members are up there already.

    February 27, 2011 at 3:40 am #29524
    amin007
    Participant

    Yeah it shouldn’t be hard to add in a shortcode that displays the total number of members. I will add it in.

    February 27, 2011 at 5:12 am #29525
    derixc
    Member

    Great. Thanks a lot. looking forward into this. :)

    February 28, 2011 at 2:37 am #29526
    amin007
    Participant

    Actually I forgot that such a shortcode already exists.

    Use the following shortcode to show a total member count:

    [wp_eMember_total_members]

    February 28, 2011 at 5:21 am #29527
    derixc
    Member

    Thanks. I was able to test it on page and it works.

    I tried using this <?php echo print_eMember_total_memebers(); ?> for my sidebar but getting error.

    What would be the correct php code for the sidebar?

    February 28, 2011 at 5:42 am #29528
    amin007
    Participant

    The correct function to call is:

    <?php echo emember_get_total_members(); ?>

    February 28, 2011 at 5:49 am #29529
    derixc
    Member

    GREAT! it’s now live on my site. thanks a lot. The support here is absolutely fantastic.

    February 21, 2012 at 5:14 pm #29530
    reepsy
    Member

    Both <?php echo emember_get_total_members(); ?> and [emember_total_memebers] bring back teh total number of all memberships, as the names would imply. I am trying to make a goal meter showing progress towards selling xx memberhips at a specific membership level. So let’s say id=3. Any suggestions?

    February 21, 2012 at 6:19 pm #29531
    reepsy
    Member

    This will work if you are interest in just the one level like I am (Level ID 3 in this example):

    function paid_membership_count() {
    global $wpdb;
    $members_table_name = $wpdb->prefix . "wp_eMember_members_tbl";
    $wp_member_count = $wpdb->get_row("SELECT count(*) as count FROM $members_table_name WHERE membership_level='3'");
    $total_number_of_members = $wp_member_count->count;
    }
    add_shortcode( 'paid_membership_count', 'paid_membership_count' );

    So you use it like any shortcode: [paid_membership_count]

    But you could easily parameritize it to do any specific level passed in as an attribute:

    [paid_membership_count level=’3′]

    October 7, 2013 at 11:38 pm #29532
    admin
    Keymaster

    We expanded our existing shortcode so you can get a total member count from a particular membership level.

    The following shortcode will give you a count of all the members from level 2:

    [wp_eMember_total_members level="2"]

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ