Find Answers and Get Support › Forums › Gwangi – PRO Multi-Purpose Membership, Social Network & BuddyPress Community Theme › Popular Features › Members Directory › Location Field no longer showing in member profile / BP Directory
- This topic has 8 replies, 2 voices, and was last updated 6 years, 1 month ago by Themosaurus.
-
AuthorPosts
-
@themosaurus
- 1 Topics
- 1675 Posts
Hi Finn,
Thank you very much for the kind words. We’ve put a lot of effort in the making of this theme to let users enjoy the best experience possible. We’re glad that it suits you. ?
Can you please create us a new user on your website? If possible with admin capabilities so we can make a quick check of your settings.
You can post the user name and password in your next private reply.Cheers,
September 4, 2018 at 14:16 #1955@themosaurus- 1 Topics
- 1675 Posts
Hi Finn,
By default the theme displays the “Country” and “City” fields in the members directory. I see that you renamed these to “County” and “Town” on your site, which is why they are not displayed anymore.
However, you can still display them by adding this simple PHP code snippet to your site:
if ( ! function_exists( 'gwangi_buddypress_member_location' ) ) : /** * Print the HTML for the Town and County 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( 'Town', bp_get_member_user_id() ); $country = xprofile_get_field_data( 'County', 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; endif; } endif;
To add a custom PHP code snippet to your site, we recommend that you use the Code Snippets plugin (https://wordpress.org/plugins/code-snippets/). For more info, we invite you to take a look at this article of our documentation:
Best regards,
September 5, 2018 at 08:43 #1960FinnParticipant@paragon- 3 Topics
- 8 Posts
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 1:
syntax error, unexpected ‘&’The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.
Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.
….
September 5, 2018 at 08:47 #1961@themosaurus- 1 Topics
- 1675 Posts
Thank you, we really appreciate your kind words. We always try to provide a solution whenever we can and if a code snippet can solve the problem then we’ll be glad to provide it.
I added the code snippet to your site and it looks like it is working now 🙂
Best regards,
September 5, 2018 at 09:00 #1963@themosaurus- 1 Topics
- 1675 Posts
You’re welcome 🙂
Best regards,
September 5, 2018 at 11:28 #1971 -
AuthorPosts
The topic ‘Location Field no longer showing in member profile / BP Directory’ is closed to new replies.