-
Author
-
January 11, 2014 at 12:17 #9548frien337Participant
Hello Everyone,
Is there a way to shows only the total number of women and men (separately) who have signed up? I see there is the shortcode to show the number of women/men online, but I could find anything too show only the amount who have signed up.
Many thanks,
RyanJanuary 12, 2014 at 21:21 #9611AbeKeymasterYou can use the statistics shortcode: [kleo_member_stats field=”” value=””]
field – Your profile field name
value – the value you want to count users forHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution---
@ SeventhQueen we do our best to have super happy customers. Thanks for being our customer.January 13, 2014 at 21:37 #9664frien337ParticipantThanks Abe. I wanted to still have the same icons that show for the member stats on the welcome page (Members in total, Men online, etc.).
I figured out a way how to do this but it may be a bit of a dirty workaround as it involves editing one of the core files, so let me know if there is a better way. If anyone wants to know, the way I got Total Men and Total Woman (signed up, not online) to show in the Welcome page’s icons is by doing this:
1:Open the bp-functions.php file (ftp://yoursite.com/wp-content/themes/sweetdate/custom_buddypress/bp-functions.php) and find this bit of code:
COPY CODEif (!function_exists('kleo_member_stats')) { function kleo_member_stats( $atts, $content = null ) { extract(shortcode_atts(array( 'field' => '', 'value' => '' ), $atts)); return bp_member_statistics($field, $value); } add_shortcode('kleo_member_stats', 'kleo_member_stats'); }
Cut it out of the document and past it above this bit of code:
COPY CODEif (!function_exists('kleo_status_icon')) { function kleo_status_icon( $atts, $content = null ) { extract(shortcode_atts(array( 'type' => 'total', 'image' => '', 'subtitle' => '', 'class' => '' ), $atts)); switch ($type) {
Scroll down and find this bit of code:
COPY CODEcase 'women_online': $image = ($image == '')? get_template_directory_uri().'/assets/images/icons/steps/status_03.png' : $image; $number = bp_get_online_users("Woman");
And replace it with:
COPY CODEcase 'women_online': $image = ($image == '')? get_template_directory_uri().'/assets/images/icons/steps/status_03.png' : $image; $number = do_shortcode('[kleo_member_stats field="I am a" value="Woman"]'); $subtitle = 'Total Women';
The field must match your user profile fields. So, for the bit of text above ” field=”I am a” value=”Woman” “, the “field” refers to the name of your sex field (e.g.: “I am a” or “sex”) and the “value” refers to the value of your sex field (e.g.: male or female). The $subtitle = ‘Total Women’; is the label of the statistic on the welcome page with ‘Total Women’ being the text that is displayed.
We need to do the same for the total of men that have signed up. Find this bit of code:
COPY CODEcase 'men_online': $image = ($image == '')? get_template_directory_uri().'/assets/images/icons/steps/status_04.png' : $image; $number = bp_get_online_users("Man");
And replace it with:
COPY CODEcase 'men_online': $image = ($image == '')? get_template_directory_uri().'/assets/images/icons/steps/status_04.png' : $image; $number = do_shortcode('[kleo_member_stats field="I am a" value="Man"]'); $subtitle = 'Total Men';
Save the file and refresh your home page and you will now see those icon stats showing total members, total men, total women, and total members online.
-
AuthorPosts
The forum ‘Sweetdate – WordPress’ is closed to new topics and replies.