• I have added social icons to the profile page.

    And when the user is editing the profile, there are boxes to ad links to Linkedin and Facebook, just as intended.

    But when the profile is displayed…only the Linkedin icon is there.
    In fact, the Facebook link isn′t even saved in the profile editor when the user edit.

    What do I do?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter olahall

    (@olahall)

    Sorry! The facebook link is saved, but not displayed in the profile.

    Link to my profile (with added and saved Facebook link);
    https://smartutbildning.se/user/olahall/

    Hi @olahall

    Did you use the Facebook pre-defined field? The icons will only show for the pre-defined social network fields and not for any custom fields you create. How to add social icons to profile header?

    Please also check the visibility settings of the field: https://screenbud.com/s/tL8qGf0fAFQ

    Thread Starter olahall

    (@olahall)

    Yes, I did…

    And I just double checked…still no FB icon visible

    @olahall

    Which PHP version are you using?

    Try this guide about How to do a plugin/theme conflict test:

    https://docs.ultimatemember.com/article/96-how-to-do-a-plugin-theme-conflict-test

    Thread Starter olahall

    (@olahall)

    I am using php version 7.1

    I have now tested in safe mode.
    I deactivated ALL plugins but UM…and the FB icon was still not visible.

    I also changed to a default theme, just to make sure it wasn′t the theme it self that caused the issue. But no, FB icon is still not visible.

    @olahall

    Look in your web browser console if you have any Javascript errors.

    Enable PHP Debug logging and post here in the Forum any error/warning messages.

    https://docs.ultimatemember.com/article/1751-enable-debug-logging

    Thread Starter olahall

    (@olahall)

    Ok, done!

    There are no Javascript errors within the Chrome Developer Console, and there are also no PHP error or notices related to the plugin being thrown on the server.

    @olahall

    no PHP error or notices related to the plugin

    If you get PHP Errors/Warnings from other plugins/theme you should post them also.

    Thread Starter olahall

    (@olahall)

    I understood that…
    There are no errors from other plugins either.

    No errors at all

    @olahall

    You can try this shortcode to list the setup of your fields facebook and linkedin and the number of users in each social group.

    Install code snippet to your child-theme’s functions.php file
    or use the “Code Snippets” plugin

    Shortcode: [um_social_fields]
    Create a new empty WP page where you insert the shortcode
    Access this page with your browser
    Post the content from this page here in the Forum

    add_shortcode( 'um_social_fields', 'my_um_social_fields_shortcode' );
    
    function my_um_social_fields_shortcode( $atts, $content = null ) {
        
        global $wpdb;
    
        $fields = UM()->builtin()->get_all_user_fields();
        $output = '';
        foreach ( $fields as $field => $args ) {
            if ( $field == 'facebook' || $field == 'linkedin' ) {
                $output .= '<br><br>Field: ' . $field;
                foreach( $args as $key => $arg ) {
                    $output .= '<br>[' . $key . '] => ' . $arg;
                }
            }
        }
    
        $users = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}usermeta WHERE <code>meta_key</code> LIKE 'facebook' " );
        if ( $wpdb->last_error ) {
            $output .= '<br><br>facebook wpdb error: ' . $wpdb->last_error;
        } else $output .= '<br><br>facebook ' . count( $users );    
        
        $users = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}usermeta WHERE <code>meta_key</code> LIKE 'linkedin' " );
        if ( $wpdb->last_error ) {
            $output .= '<br>linkedin wpdb error: ' . $wpdb->last_error;
        } else $output .= '<br>linkedin ' . count( $users );  
        
        return $output;
    }
    Thread Starter olahall

    (@olahall)

    Ok, thanks!

    Now it looks like there was an error…

    Field: facebook
    [title] => Facebook
    [metakey] => facebook
    [type] => url
    [label] => Facebook
    [required] => 0
    [public] => 1
    [editable] => 1
    [url_target] => _blank
    [url_rel] => nofollow
    [icon] => um-faicon-facebook
    [validate] => facebook_url
    [url_text] => Facebook
    [advanced] => social
    [color] => #3B5999
    [match] => https://facebook.com/
    
    Field: linkedin
    [title] => LinkedIn
    [metakey] => linkedin
    [type] => url
    [label] => LinkedIn
    [required] => 0
    [public] => 1
    [editable] => 1
    [url_target] => _blank
    [url_rel] => nofollow
    [icon] => um-faicon-linkedin
    [validate] => linkedin_url
    [url_text] => LinkedIn
    [advanced] => social
    [color] => #0976b4
    [match] => https://linkedin.com/
    
    facebook wpdb error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'meta_key LIKE 'facebook'' at line 1
    linkedin wpdb error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'meta_key LIKE 'linkedin'' at line 1

    @olahall

    Replace the code snippet with this code:

    add_shortcode( 'um_social_fields', 'my_um_social_fields_shortcode' );
    
    function my_um_social_fields_shortcode( $atts, $content = null ) {
        
        global $wpdb;
    
        $fields = UM()->builtin()->get_all_user_fields();
        $output = '';
        foreach ( $fields as $field => $args ) {
            if ( $field == 'facebook' || $field == 'linkedin' ) {
                $output .= '<br><br>Field: ' . $field;
                foreach( $args as $key => $arg ) {
                    $output .= '<br>[' . $key . '] => ' . $arg;
                }
            }
        }
    
        $users = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}usermeta WHERE meta_key LIKE 'facebook' " );
        if ( $wpdb->last_error ) {
            $output .= '<br><br>facebook wpdb error: ' . $wpdb->last_error;
        } else $output .= '<br><br>facebook ' . count( $users );    
        
        $users = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}usermeta WHERE meta_key LIKE 'linkedin' " );
        if ( $wpdb->last_error ) {
            $output .= '<br>linkedin wpdb error: ' . $wpdb->last_error;
        } else $output .= '<br>linkedin ' . count( $users );  
        
        return $output;
    }
    • This reply was modified 2 years, 3 months ago by missveronica.
    Thread Starter olahall

    (@olahall)

    Then it looks like this…

    Field: facebook
    [title] => Facebook
    [metakey] => facebook
    [type] => url
    [label] => Facebook
    [required] => 0
    [public] => 1
    [editable] => 1
    [url_target] => _blank
    [url_rel] => nofollow
    [icon] => um-faicon-facebook
    [validate] => facebook_url
    [url_text] => Facebook
    [advanced] => social
    [color] => #3B5999
    [match] => https://facebook.com/

    Field: linkedin
    [title] => LinkedIn
    [metakey] => linkedin
    [type] => url
    [label] => LinkedIn
    [required] => 0
    [public] => 1
    [editable] => 1
    [url_target] => _blank
    [url_rel] => nofollow
    [icon] => um-faicon-linkedin
    [validate] => linkedin_url
    [url_text] => LinkedIn
    [advanced] => social
    [color] => #0976b4
    [match] => https://linkedin.com/

    facebook wpdb error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘meta_key LIKE ‘facebook” at line 1
    linkedin wpdb error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘meta_key LIKE ‘linkedin” at line 1`

    @olahall

    A new trial with modified code to replace your last code snippet:

    add_shortcode( 'um_social_fields', 'my_um_social_fields_shortcode' );
    
    function my_um_social_fields_shortcode( $atts, $content = null ) {
        
        global $wpdb;
    
        $fields = UM()->builtin()->get_all_user_fields();
        $output = '';
        foreach ( $fields as $field => $args ) {
            if ( $field == 'facebook' || $field == 'linkedin' ) {
                $output .= '<br><br>Field: ' . $field;
                foreach( $args as $key => $arg ) {
                    $output .= '<br>[' . $key . '] => ' . $arg;
                }
            }
        }
    
        $users = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}usermeta WHERE meta_key='facebook' " );
        if ( $wpdb->last_error ) {
            $output .= '<br><br>facebook wpdb error: ' . $wpdb->last_error;
        } else $output .= '<br><br>facebook ' . count( $users );    
        
        $users = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}usermeta WHERE meta_key='linkedin' " );
        if ( $wpdb->last_error ) {
            $output .= '<br>linkedin wpdb error: ' . $wpdb->last_error;
        } else $output .= '<br>linkedin ' . count( $users );  
        
        return $output;
    }
    Thread Starter olahall

    (@olahall)

    I don′t know if it matters, but as I edited and activated this code, there was a fatal error. I pasted into the snippet again, exactly the same, and it was saved without issues.

    This is the result…

    Field: facebook
    [title] => Facebook
    [metakey] => facebook
    [type] => url
    [label] => Facebook
    [required] => 0
    [public] => 1
    [editable] => 1
    [url_target] => _blank
    [url_rel] => nofollow
    [icon] => um-faicon-facebook
    [validate] => facebook_url
    [url_text] => Facebook
    [advanced] => social
    [color] => #3B5999
    [match] => https://facebook.com/

    Field: linkedin
    [title] => LinkedIn
    [metakey] => linkedin
    [type] => url
    [label] => LinkedIn
    [required] => 0
    [public] => 1
    [editable] => 1
    [url_target] => _blank
    [url_rel] => nofollow
    [icon] => um-faicon-linkedin
    [validate] => linkedin_url
    [url_text] => LinkedIn
    [advanced] => social
    [color] => #0976b4
    [match] => https://linkedin.com/

    facebook wpdb error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘meta_key LIKE ‘facebook” at line 1
    linkedin wpdb error: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘meta_key LIKE ‘linkedin” at line 1`

Viewing 15 replies - 1 through 15 (of 32 total)
  • The topic ‘Social Icons not visible’ is closed to new replies.