Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Website Setup › Pages › Show subtitles on members directory
- This topic has 3 replies, 2 voices, and was last updated 6 years ago by
Themosaurus.
-
AuthorPosts
-
BradieParticipant@bradieb
- 4 Topics
- 10 Posts
Show subtitles on members directory
I saw a previous post saying y default, if you want the age, city and country displayed on the members cards, your profile fields need to be named exactly like this:
* Birthdate
* City
* CountryAnd that you would provide the code snippet for those that want to change the name of these fields and still display them.
Can you please provide the code snippet for the specific fields:
* What is it?
* URL
* Short DescriptionFebruary 25, 2019 at 23:10 #5543@themosaurus- 1 Topics
- 1675 Posts
Hi @bradieb,
Thank you for your precious feedback.
There is definitely a missing feature in our theme which will be fixed in the next update. You’ll be able to dynamically pick and choose the extended profile fields to display on member cards and profiles.
So, if you’re not in too much of a hurry, we’ll fixed this for you. Otherwise, we can provide a short snippet.
Cheers,
February 27, 2019 at 17:57 #5602BradieParticipant@bradieb- 4 Topics
- 10 Posts
Hi @themosaurus if you could please provide a short snippet for the specific fields:
* What is it?
* URL
* Short DescriptionThanks,
February 27, 2019 at 20:04 #5603@themosaurus- 1 Topics
- 1675 Posts
Hi @bradieb,
Please try to add the following code snippet to your website:
if ( ! function_exists( 'gwangi_buddypress_member_location' ) ) : /** * Print the HTML for the City and Country XProfile Field in the BP Member Directory. * * @since 1.0.0 */ function gwangi_buddypress_member_location() { if ( function_exists( 'xprofile_get_field_data' ) ) : $city = xprofile_get_field_data( 'City', bp_get_member_user_id() ); $country = xprofile_get_field_data( 'Country', bp_get_member_user_id() ); // Extra xprofile fields. $what = xprofile_get_field_data( 'What is it?', bp_get_member_user_id() ); $url = xprofile_get_field_data( 'URL', bp_get_member_user_id() ); $desc = xprofile_get_field_data( 'Short Description', bp_get_member_user_id() ); $allowed_html = array( 'a' => array( 'href' => array(), 'rel' => array(), ), ); if ( ! empty( $city ) && ! empty( $country ) ) : ?> <div class="bp-member-xprofile-custom-field bp-member-location"><?php echo wp_kses( $city, $allowed_html ); ?>, <?php echo wp_kses( $country, $allowed_html ); ?></div> <?php endif; if ( ! empty( $what ) ) : ?> <div class="bp-member-xprofile-custom-field bp-member-what"><?php echo wp_kses( $what, $allowed_html ); ?></div> <?php endif; if ( ! empty( $url ) ) : ?> <div class="bp-member-xprofile-custom-field bp-member-url"><?php echo wp_kses( $url, $allowed_html ); ?></div> <?php endif; if ( ! empty( $desc ) ) : ?> <div class="bp-member-xprofile-custom-field bp-member-desc"><?php echo wp_kses( $desc, $allowed_html ); ?></div> <?php endif; endif; } endif;
To add this code snippet to your site, we recommend that you use a the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). If you have never activated this plugin, please read the following post:
Please also note that we don’t provide any theme customization. So, you shouldn’t expect other snippets from us unless it’s to fix an issue stemming from our own codebase. We always try our best to help theme users whenever we can and only provide code snippets out of courtesy to prevent them from waiting for the next update.
Regards,
February 28, 2019 at 18:49 #5610 -
AuthorPosts
Hi there,
This topic has been inactive for a while now so we will be closing it to keep the forum tidy. Don't hesitate to create a new topic if you still need help and we'll be glad to help you!
Best regards,
The Themosaurus team.
The topic ‘Show subtitles on members directory’ is closed to new replies.