• I moved our website to a new server and now all the avatars are not showing. The inbuilt feature to overwrite the get_avatar() function was working fine before but now its not working. Any suggestion?

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

Viewing 1 replies (of 1 total)
  • Thread Starter Aslam Doctor

    (@aslamdoctor)

    Hi Again,

    I have fixed the issue. Please note about this as this is issue with wordpress and I had to add a workaround for it which can be useful for you too.

    You have used the function attachment_url_to_postid() in your plugin which doesn’t work on some servers. No idea why. So I added this code on line 249 where you have the code

    $attachment_id = attachment_url_to_postid( $attachment_upload_url );

    And replaced it with

    global $wpdb;
    $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid='%s';", $attachment_upload_url ) );
    $attachment_id = $attachment[0];
Viewing 1 replies (of 1 total)
  • The topic ‘Avatars not showing up after moving to different server’ is closed to new replies.