• Resolved stephunique

    (@stephunique)


    Is there a way to have a short preview (say, either a summary of the member’s profile using their profile field or the first 2-3 lines of their bio, preferred method) of a member’s profile information when someone searches my website for members in my profile?

    At the moment, it only shows the cover photo/avatar and name of the user, no preview of profile. I want my users to be able to see a preview so they can decide which one to select.

    Thanks
    stephanie

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Towhid

    (@cryptex_vinci)

    Hi @stephunique

    You can display additional information by following below steps:

    1. Go to Ultimate Member > Member Directories
    2. Select the directory you want to edit
    3. Scroll down to “Profile cards”
    4. Check the “Show tagline below profile name” field
    5. Choose the field you want to display from “Choose field(s) to display in tagline”
    6. Click on Update.

    Thread Starter stephunique

    (@stephunique)

    Thanks @cryptex_vinci I have since found this option after posting this request. However, it displays all of the information in that field. I want to display the first 2 lines of text, of say, their bio, so that searchers can look at the various members and choose a person to click on. At the moment, it shows 100% of the text in that field, so if someone wrote a 5 paragraph of free text, then all 5 paragraphs will show. This looks ugly and inconsistent if other users put no text.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @stephunique

    You can try this code snippet below to show the first 20 words of the text area field value as the tagline. You must change the meta key long_description with your field key.

    add_filter("um_ajax_get_members_response","custom_um_ajax_get_members_response", 10, 2 );
    function custom_um_ajax_get_members_response( $response, $member_directory_data ){
    
        $users = $response['users'];
        $arr_users = [ ];
        foreach( $users as $user ){
    
            $user["long_description"] = wp_trim_words( $user['long_description'], 20 );
    
            $arr_users[ ] = $user;
        }
    
        $response['users'] = $arr_users;
    
        $response['member_directory'] = $member_directory_data;
        
        return $response;
    }
    

    Regards,

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to show a preview of member’s profile in search results?’ is closed to new replies.