Tips and Tricks HQ Support Portal › Forums › WP eMember › How to display the 'total of members' on a page or post?
- This topic has 7 replies, 3 voices, and was last updated 14 years, 6 months ago by nur.
-
AuthorPosts
-
May 6, 2010 at 8:03 am #1175nicoolasMember
Hello,
I would like to show on my blog the total of leads.
I stop the subscription to the first 300 members after it’s paying.
So, I found a php code into the ‘dashboard menu’ file. I would like to know if it’s possible to get the shotcode to display the total members of the blog ??
Thanks for your great support.
nicolas
May 6, 2010 at 2:37 pm #20393amin007ParticipantYou will have to create the shortcode. First you will need to write the function that displays the total number of members then you can add in the shortcode functionality. If you have the function ready (the function that displays the total number of members) then I can tell you how to create a shortcode that exercises that function.
May 6, 2010 at 9:43 pm #20394nicoolasMemberHi,
I think that I’ve got the php function.
Could you tell me how to create a shortcode ?
thanks,
nicolas
May 7, 2010 at 12:57 am #20395amin007ParticipantThis link should help you with that:
http://codex.wordpress.org/Shortcode_API
In short you will have to add something like the following to the “wp_eMember1.php” file:
add_shortcode('wp_eMember_display_total_members', 'display_total_members_count);
function display_total_members_count($atts)
{
return your_function_name();
}Then you can use the following shortcode to display the output of the your_function_name() function:
[wp_eMember_display_total_members]
remember you should not put any echo in the “your_function_name”. You should add all the output string to a variable then return it.
May 7, 2010 at 10:07 am #20396nicoolasMemberHi,
I totally lost…..
I’ve try to :
insert the code to the “wp_eMember1.php” but nothing happen. I don’t know where insert the code.
So, I insert this :
add_shortcode(‘wp_eMember_display_total_members’, ‘wp_eMember_display_total_members_handler’);
function eStore_remaining_copies_counter($atts)
{
return show_total_members();
}
BUT I’m not sure about the “function_name”.
I’m not a geek and php isn’t my favorite branch matter….
I tink that the php code is : <?php echo $wp_total_members[0]->count; ?>
So I don’t know ‘changing’ like an output string…
sorry, I’m really bad in programmation
nicolas
May 8, 2010 at 12:55 am #20397amin007ParticipantLOL… okay my co-developer of this plugin has added a shortcode for you that can be used to display the total number of members.
You can either use the following shortcode on a post or page:
[wp_eMember_total_members]
or use the following PHP code to display the total members from your theme’s template file:
<?php echo emember_get_total_members(array()); ?>
I have sent you an updated version of the plugin.
May 8, 2010 at 7:20 am #20398nicoolasMemberMany thanks.
I’m blown away. I never seen a support like yours.
It’s like “open source”. We give some ideas and you do it. Resultat : the most complete WP plugins that I’ve never seen.
Best Best regard,
nico
May 8, 2010 at 6:58 pm #20399nurMemberit feels great to have such comments. It inspires us a lot
-
AuthorPosts
- You must be logged in to reply to this topic.