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

Due to the decrease in our staff due to vacations, our response time may be longer.

Be sure we're doing our best to manage your topic as soon as possible.

Age and City do not appear in the cards and in the profile

This topic is resolved
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • Antonello
    Participant
    • 5 Topics
    • 15 Posts
    @antonellogulino

    Hi Guys, congratulations for the excellent work ..
    Unfortunately in my web, I still can not fix this thing:
    Age of Member and City, do not appear in member cards and in profile.
    How can I solve, can you help me?
    Thank you
    Antonello
    in Attachment screenshot

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

    Hi @antonellogulino,

    Thank you very much for the kind words! We really appreciate your comment! ?

    Could you please create a new website user for us? If possible with administrator capabilities so we can make a quick check of your settings.
    You can post the user name and password in your next reply and mark it private to keep this between us.

    Cheers,

    Antonello
    Participant
    • 5 Topics
    • 15 Posts
    @antonellogulino
    This reply has been marked as private.
    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    Hi @antonellogulino,

    Thank you for sharing the URL to your website with us. At first glance, the issue might be coming from the fact that your fields changed from the names that we gave them. Usually, BuddyPress seems to look for fields with the exact same names.

    To fix this, simply add the following code snippet to your website:

    if ( ! function_exists( 'gwangi_buddypress_member_birthdate' ) ) :
    	/**
    	 * Print the HTML for the Birthdate XProfile Field in the BP Member Directory.
    	 *
    	 * @since 1.0.0
    	 */
    	function gwangi_buddypress_member_birthdate() {
    		if ( function_exists( 'xprofile_get_field_data' ) ) :
    
    			$birthdate_field_id = xprofile_get_field_id_from_name( 'Data di nascita' );
    
    			if ( ! empty( $birthdate_field_id ) ) :
    				$birthdate                = xprofile_get_field_data( $birthdate_field_id, bp_get_member_user_id() );
    				$birthdate_field_settings = BP_XProfile_Field_Type_Datebox::get_field_settings( $birthdate_field_id );
    
    				if ( 'elapsed' !== $birthdate_field_settings['date_format'] ) :
    					$birthdate_datetime = DateTime::createFromFormat( $birthdate_field_settings['date_format'], $birthdate );
    					if ( ! empty( $birthdate_datetime ) ) :
    						$age = $birthdate_datetime->diff( new DateTime( 'now' ) )->y;
    					endif;
    				endif;
    
    				$allowed_html = array(
    					'a' => array(
    						'href' => array(),
    						'rel'  => array(),
    					),
    				);
    				if ( ! empty( $age ) ) : ?>
    					<div class="bp-member-xprofile-custom-field bp-member-birthdate"><?php echo wp_kses( $age, $allowed_html ); ?></div>
    				<?php
    				endif;
    			endif;
    		endif;
    	}
    endif;
    
    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( 'Città', bp_get_member_user_id() );
    			$country      = xprofile_get_field_data( 'Paese', 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;

    It will override the functions that we’ve created to display this xProfile fields.

    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:

    Adding Custom PHP Without Changing Your Child Theme

    We hope that it will solve your issue.

    Regards,

    Antonello
    Participant
    • 5 Topics
    • 15 Posts
    @antonellogulino

    Hi guys thank you but:
    1 problem is solved
    2 no
    in the profile does not appear
    in the swap does not appear

    Antonello
    Participant
    • 5 Topics
    • 15 Posts
    @antonellogulino

    Sorry
    I deleted the cache and everything works 🙂

    Thank you

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

    You’re welcome. ?

    Best regards,

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

The topic ‘Age and City do not appear in the cards and in the profile’ 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 ❤️

Discover MatchPress

Skip • Like • Super-Like

Add powerful matching features like Member likes, skips, super likes, conditional private messaging and much more.

Setup Your Cera or Gwangi powered Community Website and Turn it into an iOS and Android App

15% discount for Cera users

To unleash the full power of your Cera or Gwangi theme, we have partnered with the Zipline team. Your community website can now be fully setup and turned into your very own custom app for iOS and Android.

Whether you've newly acquired the theme or already got your site up and running, Zipline got you covered. And we got you an incredible discount.

Holiday, Weather & Festive effects
to pimp your WordPress Site