Support only during business hours : Monday to friday, from 8:30 am – 5:30 pm CEST

In regards to the COVID-19 situation

Your support team is currently doing their best to offer the best support possible despite the current COVID-19 situation. However during these exceptional circumstances, please note that you should expect a response time of 2-3 business days, until further notice.Rest assured that we will still do our best to handle your requests as soon as possible! Everyone stay safe and healthy! 😷

Location Field no longer showing in member profile / BP Directory

This topic is resolved
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • Finn
    Participant
    • 3 Topics
    • 8 Posts
    @paragon

    Hi guys, I can’t see the location field since updating the members search, I’ve tried re-generating default fields to no avail.

    Ps. Great theme, Pleasure to work with so far.

    Regards,
    Finn

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1673 Posts
    @themosaurus

    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,

    Finn
    Participant
    • 3 Topics
    • 8 Posts
    @paragon
    This reply has been marked as private.
    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1673 Posts
    @themosaurus

    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:

    Adding Custom PHP Without Changing Your Child Theme

    Best regards,

    Finn
    Participant
    • 3 Topics
    • 8 Posts
    @paragon

    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.

    ….

    Finn
    Participant
    • 3 Topics
    • 8 Posts
    @paragon

    Feel free to try yourself. I appreciate you writing code for this. Your a diamond.

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1673 Posts
    @themosaurus

    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,

    Finn
    Participant
    • 3 Topics
    • 8 Posts
    @paragon

    Amazing. Thank you so much dude.

    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1673 Posts
    @themosaurus

    You’re welcome 🙂

    Best regards,

Viewing 9 posts - 1 through 9 (of 9 total)

The topic ‘Location Field no longer showing in member profile / BP Directory’ is closed to new replies.

Troubleshooting Demo Imports

You're trying to setup your theme but you're experiencing errors when importing the demo content? Or you've just followed the setup guide but your website doesn't look exactly like our demo? These are common issues for which you can find easy and quick fixes.

Happy With our Support So Far?

Feel free to review our theme on Themeforest! It helps us making our products more known to new potential customers, which allow us more time to improve the quality and develop new features. #SharingIsCaring ❤️