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.

Profile Field data displayed on members' cards on Directory page disappear

This topic is resolved
Viewing 17 posts - 1 through 17 (of 17 total)
  • Author
    Posts
  • Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades

    Following advice you have given in reply to queries from several members, I have created and activated a code snippet to display Gender, Age, country, etc, on the member cards in the Directory. This works fine when the Directory page first loads. But, if I then click on “Last Active” and select “Newest Registered” or “Alphabetical”, the newly-sorted Directory shows the member cards with the Gender, Age, Country, etc, missing – only the Name is played. However, if I the hit “Reload”, the Gender, Age, etc. re-appear.

    How can I fix this problem?

    Here is the the code snippet that I am using –

    if ( ! function_exists( ‘gwangi_buddypress_member_location’ ) ) :
    /**
    * Print the HTML for the Age 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’ ) ) :
    $age = xprofile_get_field_data( ‘Age’, bp_get_member_user_id() );
    $gender = xprofile_get_field_data( ‘Gender’, bp_get_member_user_id() );
    $country = xprofile_get_field_data( ‘Country’, bp_get_member_user_id() );
    $seeking = xprofile_get_field_data( ‘Seeking’, bp_get_member_user_id() );
    $for = xprofile_get_field_data( ‘For’, bp_get_member_user_id() );
    $allowed_html = array(
    ‘a’ => array(
    ‘href’ => array(),
    ‘rel’ => array(),
    ),
    );
    if ( ! empty( $age ) && ! empty( $country ) && ! empty( $for )) : ?>
    <div class=”bp-member-xprofile-custom-field bp-member-location”><p style=”text-align:left;”> <?php echo wp_kses( $gender, $allowed_html ); ?>     <?php echo wp_kses( $age, $allowed_html ); ?> <br> <?php echo wp_kses( $country, $allowed_html ); ?> <br> <small> Seeks .. </small> <?php echo wp_kses( $seeking, $allowed_html ); ?> <br> <small> For .. </small> <?php echo wp_kses( $for, $allowed_html ); ?></p> </div>
    <?php
    endif;
    endif;
    }
    endif;

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

    Hi @elsades,

    We’ve tried to reproduce this issue on our development websites but it seems to work fine for us (please view attachment).

    Our guesses are that:
    – You might have a caching plugin activated, messing with the AJAX directory reload. In that case, please empty page caches and try again to see that’s resolving your issue.
    – You might have another unknown or untested BuddyPress add-on changing the way the AJAX directory reload works. In that case, please deactivate all plugins except the plugins recommended with Gwangi and Code Snippets. Then, retry to filter your page to see if that issue is resolved.

    We’re curious to know what’s causing this issue on your website.

    Thank you.

    Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades

    Thak you for your interest in this problem.
    I don’t know how to “empty page caches”. Can you direct me?

    Cheers

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

    Hi @elsades,

    Do you have any caching plugin activated?

    If you’re not sure, you can share with us a screenshot showing the list of activated plugins. You can post it in your next reply and mark it as private to keep this between us.

    Cheers,

    DEMENTE
    Participant
    • 51 Topics
    • 178 Posts
    @chilepower

    Permission and excuse my interference @themosaurus, but I would like to know how he managed @elsades to put these message icons and friendship request

    Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades

    I deactivated all plugins except for the ones present in the initial setup but the problem persisted. I also deactivated all code snippets (except the one which displays the extra profile fields on the members’ cards) but this did not fix the problem either. Could there be something wrong with the code snippet that I am using?

    Cheers

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

    Hi @chilepower,

    Could make sure that the following BuddyPress components are activated please?
    – Friend Connections
    – Private Messaging

    You can check the box related with these options by navigating to “Settings > BuddyPress > Components”.

    Best,

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

    Hi @elsades,

    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 as private to keep this between us.

    Cheers,

    Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades
    This reply has been marked as private.
    Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades
    This reply has been marked as private.
    Themosaurus
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 1675 Posts
    @themosaurus

    Hi @elsades,

    We’re not able to log into your website. Could make sure your login page is still online? It seems that something might be going wrong with the redirection set in place as your website is throwing “TOO MANY REDIRECT” error.

    Cheers,

    Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades

    Sign-ins are now working.

    Cheers

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

    You’re welcome. ?

    Best regards,

    Jason
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 430 Posts
    @themoceratops

    Hi @elsades,

    I closed your other topic and reopened this one since the problem has indeed not been fixed. Sorry about that.

    I will be looking at the issue and come back to you when I find out more.

    Best regards,

    Jason
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 430 Posts
    @themoceratops

    I took a look at your website and found the source of the issue.

    In the snippet you created to display the custom fields, you checked the “Only run on site front-end” option which is why it didn’t work when sorting the members. That happens because when you sort the members they are reloaded via AJAX, which is not considered front-end. So I went ahead and checked “Run snippet everywhere” and it looks like the issue is now fixed.

    Best regards,

    Des Somebody
    Participant
    • 15 Topics
    • 41 Posts
    @elsades

    Thanks for solving my problem and for giving a clear explanation of what I had done wrong.

    By the way, I chose to set the “only run on site front end” option because of your general recommendation in your “adding-custom-php-without-changing-your-child-theme” article.

    Cheers.

    Jason
    Keymaster
    Themosaurus Support
    • 1 Topics
    • 430 Posts
    @themoceratops

    Glad I could help you @elsades 🙂

    Thank you for noticing us of that line in the article, I have made a small change to hopefully make it less confusing.

    Best regards,

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

The topic ‘Profile Field data displayed on members' cards on Directory page disappear’ 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