Fix | Thumbnails Not Working in a WordPress Theme From Elegant Themes

On some web hosts, thumbnails do not work if you use the latest version of a themes from Elegant Themes, or if you update your theme to the latest version.

If you see the source code of the page, you’ll either see the full absolute path of the image is used or no path is displayed at all.

This is a problem with web hosting environment and can be fixed easily. To fix this, first check if php GD is installed on your web server. If its not installed, then contact your web host and ask them to install it. This will solve the thumbnails issue.

If PHP GD library is installed on your web server, and thumbnails are still not visible, then login to your WordPress dashboard, and go to Settings > media, and make sure that the uploads path is set to default value.

If its set to some different value, then change it to wp-content/uploads.

Update: If you are using WordPress 3.5 or above, you will not see media upload settings in your WordPress dashboard. That’s ok, please ignore this step.

If thumbnails are still not working on your website, then login via FTP to your web server and make sure that the uploads and the et_temp folders are fully writable, that is, they have 755 or 777 permission depending upon the security configuration of your web server. Try 755 first as its more secure.

Another issue I have seen on some web servers is that the et_temp folder do not have the proper owner so the theme cannot save re-sized thumbnails in it. To fix this owner issue, log in via FTP and delete this folder and then re-create it again at the same place. Check if the thumbnails are working fine now.

If the thumbnails are still not visible, then go to Appearance > Editor in your WordPress dashboard, and select custom-functions.php file from right side to edit.

Update: In the latest version of themes, this file is renamed to custom_functions.php.

Find the following code in this file, and comment the marked lines,

if ( false !== get_option( 'et_images_temp_folder' ) ) return;
$uploads_dir = wp_upload_dir();
$destination_dir = ( false === $uploads_dir['error'] ) ? path_join( $uploads_dir['basedir'], 'et_temp' ) : null;
if ( ! wp_mkdir_p( $destination_dir ) ) update_option( 'et_images_temp_folder', '' );
else {
update_option( 'et_images_temp_folder', preg_replace( '#\/\/#', '/', $destination_dir ) );
update_option( 'et_schedule_clean_images_last_time', time() );
}

The edited code snippet will look like this,

#if ( false !== get_option( 'et_images_temp_folder' ) ) return;
$uploads_dir = wp_upload_dir();
$destination_dir = ( false === $uploads_dir['error'] ) ? path_join( $uploads_dir['basedir'], 'et_temp' ) : null;
#if ( ! wp_mkdir_p( $destination_dir ) ) update_option( 'et_images_temp_folder', '' );
#else {
update_option( 'et_images_temp_folder', preg_replace( '#\/\/#', '/', $destination_dir ) );
update_option( 'et_schedule_clean_images_last_time', time() );
#}

Now save this file and go to your homepage and reload the page. The thumbnails will now appear fine. Now go back to Appearance > Editor and roll back the changes you made above.

If you see an error message after editing the custom-functions.php file, then it means that you did not edit the file correctly. In this case, replace the file via FTP to fix the error and edit it again, correctly.

Update: If you are using WordPress Network or WordPress multisite, and you have followed each of the above steps, and the thumbnails are still not working, then open custom_functions.php file and remove the following code from it,

if ( is_multisite() ){
   switch_to_blog(1);
   $site_uri = site_url();
   restore_current_blog();
}

I hope that thumbnails will work fine on your site now. If they still don’t work, then contact me at Elegant Themes support forum with details.

Comments

  1. Gerrit:

    Thanks, this fixed the thumbnail issues I had after upgrading to the eBusiness theme version 5.1.

  2. Christian:

    Hi, I thought this would fix my thumbnails issue in Deep Focus which is that thumbnails are always portrait oriented now as opposed to landscape as they were before in v2.7 (currently running 3.3). DF is a photo oriented theme and as such should allow thumbnails to auto adjust to the original proportions regardless of the w x h pixel dimensions. If there is a control somewhere I have been hunting for it for weeks. Or perhaps you could supply a script. Running WP3.3.1. Thanks.

  3. Dave:

    Confirmed. Fixed thumbnails and slider images that had disappeared after migrating a site to a new domain name. Thank You!

  4. Kais72:

    Confirmed. Fixed thumbnail issue after uploading website from localhost to web server. Thanks!

  5. Jane:

    Thanks so much. It worked! I had tried to migrate the site, made a complete stuff up then got the site restored back into the working directory but no thumbnails. All working now. Legend.

  6. bluantinoo:

    Thank you man. Can I ask you what are the commented lines in custom-functions.php?
    I had installed GD library, but actually my theme was not using timthumb.
    So, what are that lines about?

  7. Kyle:

    You have no idea how many hours I’ve spent trying to fix this problem! Your final method of altering the custom-functions.php is what did the trick for me. Thank You.

  8. Pearl:

    I can’t find the custom-functions file. I only have theme-functions and phpthumb functions file. Help.

  9. Mayur Somani:

    @Christian

    Currently Elegant Themes uses default WordPress thumbnail generation functions. There is no way to pre-define crop positions in that functions as of now.

    @bluantinoo

    It sets the path to temp ET directory that stores re-sized images.

    @Pearl

    Make sure you are using the latest version of WordPress theme.

  10. Absalón:

    I have a network installation running wp 3.3.2 with thesource elegant theme3.5 on two sites. On the parent site the thumbs are working perfectly but on the other site (which was installed via the subdirectories install) the thumbs do not apear. When you check it with ‘inspect element’ no image path is displayed at all.

    Do you have any idea what can it be? I already tried doing what you suggested on this article, except the part where you directly modify the custom-functions.php.

  11. Wojtek:

    Changing path to uploads folder fixed the problem with thumbnails! Thanks a lot. Soo simple and clever, I used to have problems with images when I was changing a server, and didn’t noticed that option – saves time without changing db. Respect!

  12. Brian Jambor:

    This post just saved me several hours of manual updates. Thank you.

  13. Olivier:

    Yes! Since it occured when my host moved my website to another server I thought it was their fault. Your tutorial fixed my problem quite easily. Thanks.

  14. Mayur Somani:

    @Absalón

    Try the PHP fix also. It will solve your thumbnail issue.

  15. Finch:

    Oh there it is. Thanks for this! I’m using ET’s Modest theme and after moving my WP files from a subfolder to the root folder, thumbnails are suddenly not working. Thanks for the fix :)

  16. Gary Ploski:

    Heads up… After searching and searching I finally found out why I couldn’t find custom-functions.php. It’s called custom_functions.php in the latest version of SimplePress and it’s within the epanel folder in the SimplePress theme.

    Unfortunately this fix did not work for me.

  17. Mayur Somani:

    I have updated the post with new fixes. It should work in all cases now.

  18. Gypsyk:

    Thanks a lot. The PHP GD was the problem.

Comment?

Your email address will not be published. Required fields are marked *