WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Thumbnails Suddenly Stopped Working (16 posts)

  1. altfgcom
    Member
    Posted 2 years ago #

    Hello,

    Thumbnails as featured images were working just fine until two days ago, when the site was moved to a new hosting company.

    Scaled images (150 x 150) were automatically created and used on homepage/archive excerpts. (www.altfg.com)

    But in the last two days, **ONLY** full-size images have been uploaded to wp-uploads. Since I'm given no choice, I must select them as "featured images." (I'm given no choice to edit those images, either.) They do appear as thumbnails on the homepage/tag archives, but browsers are actually downloading the full-sized image. Not a thumbnail. That has really slowed things down for the homepage and several tag archive pages.

    I've spent nearly all day today looking through posts and comments in this forum and elsewhere, but I've found nothing that directly relates to the problem I'm having.

    The questions I have are:

    a) How can I make **thumbnails** the default option when I upload an image from my computer (either flash or browser uploader) to wp-uploads?

    b) How can I ensure that ONLY the thumbnail version will be uploaded?

    c) This is something else, though still related to this thumbnail issue: I've realized that wp-uploads now has three (or four?) copies of each image on the site, in various sizes. Is there a way for me to get rid of ALL those images EXCEPT for the thumbnails?? (I already have the full-sized images located elsewhere on the site's root folder.)

    Below is the thumbnail-related functions.php code I have:

    if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
    add_image_size( 'custom_thumb', 150, 150, true);
    }
    
    if (function_exists('add_filter'))
    add_filter( 'the_excerpt', 'excerpt_thumbnail' );
    function excerpt_thumbnail($excerpt){
        if(is_single()) return $excerpt;
        global $post;
        if ( has_post_thumbnail() ) {
            $img .= '<a>ID).'">'.get_the_post_thumbnail($post->ID, 'custom_thumb').'</a>';
        } else {
            $img = '';
        }
        return $img.$excerpt;
    }

    Any assistance would be *much* appreciated.

  2. Tara
    Member
    Posted 2 years ago #

    -try deactivating ALL plugins temporarily to narrow down the problem. If the problem goes away, activate them individually (one-by-one) to find the problematic plugin.

  3. altfgcom
    Member
    Posted 2 years ago #

    Thanks, I'll try doing that -- BUT all plugins I have now were already in place before the problem began -- and there haven't been any updates in the last couple of days.

    The thumbnail problem began this past Tuesday, after a move to a new hosting company. The site is currently on a VPS server at hostgator.com.

    So, I'm wondering if it's some sort of server issue (memory? permissions?) that's causing this.

  4. altfgcom
    Member
    Posted 2 years ago #

    All plugins were deactivated.

    As expected, the thumbnail problem continued...

    I've since reactivated all of them (about ten).

  5. altfgcom
    Member
    Posted 2 years ago #

    I was also wondering if anyone has any idea if this could be server configuration issue.

    A couple of WordPress functions stopped working after the move, but once the hosting company increased the memory available for the site, those issues were taken care of.

    Any ideas?

    That would be MUCH appreciated. This has been a major headache.

  6. esmi
    Forum Moderator
    Posted 2 years ago #

    Ask your hosts to push the memory up another notch. It could well be another memory issue.

  7. altfgcom
    Member
    Posted 2 years ago #

    esmi,

    Thank you for your response. I'll be contacting the hosting company right away.

    Also, if you don't mind, any ideas regarding my questions a), b), and c)?

    Questions a) & b): The featured image *is* being created, but only in full-size mode. Is there a way to force it to create the featured image as a thumbnail? And ONLY as a thumbnail of a SINGLE, specific size?

    Question c) relates to something else: Last night I found out that wp-uploads now has three (or four?) copies of each image on the site, in various sizes. Is there a way for me to get rid of ALL those images EXCEPT for the small thumbnails?? (I already have the full-sized images located elsewhere on the site's root folder.)

    Your assistance -- and that of anybody else's -- would be MUCH appreciated.

  8. esmi
    Forum Moderator
    Posted 2 years ago #

    Instead of:

    if ( function_exists( 'add_theme_support' ) ) {
    add_theme_support( 'post-thumbnails' );
    add_image_size( 'custom_thumb', 150, 150, true);
    }

    try:

    if ( !function_exists( 'my_theme_support' ) ) :
    function my_theme_support() {
      add_theme_support( 'post-thumbnails' );
      add_image_size( 'custom_thumb', 150, 150, true);
    }
    endif;
    add_action( 'after_setup_theme', 'my_theme_support' );

    Note: Your excerpt_thumbnail() function has gotten mangled as it wasn't posted using the [code] button.

  9. drwilson89
    Member
    Posted 2 years ago #

    Hi, I lost the thumbnails on my own site's Popular Posts plugin.
    Maybe the solution for both of our problems will be forthcoming.

    I looked at the html program for Popular Posts and could not find an obvious place where it allows me to opt in for thumbnails, nor how to create them.

    This likely will be solved soon, it seems like a fairly basic function and was only problematic because of security problems relating to Tom Thum or something.

    Best wishes to you all out there on the cyberfrontier!

    Ralph Wilson (my blog with missing thumbnails is: http://naturalconnectionshealthcare.com/blog/)

  10. altfgcom
    Member
    Posted 2 years ago #

    Thank you again, Esmi.

    What is the new code supposed to do?
    I applied it, saved it, but WP continues to load only full-sized images.

    I have SuperCache/CloudFlare caching installed. Should I purge the cache(s) of both to see the new rule implemented? Please let me know when you get a chance.

    Thanks again.

  11. esmi
    Forum Moderator
    Posted 2 years ago #

    What is the new code supposed to do?

    The add_theme_support and add_image_size need to be hooked into something to get them to fire. Otherwise they'll just sit there and do nothing.

    Should I purge the cache(s) of both to see the new rule implemented?

    Absolutely. Yes.

  12. esmi
    Forum Moderator
    Posted 2 years ago #

    @drwilson89: It is considered impolite to interrupt another poster's thread - especially given that your issue is totally unrelated to the topic. Please post a new topic in your plugin's dedicated forum.

  13. altfgcom
    Member
    Posted 2 years ago #

    Unfortunately, the problem continues even though I've purged the SuperCache/Cloud Flare caches.

    Only full-size images are uploaded after they're "crunched." No option for choosing other sizes. No option for editing the images.

    This is the current code I have in the site's functions.php:

    if ( !function_exists( 'my_theme_support' ) ) :
    function my_theme_support() {
      add_theme_support( 'post-thumbnails' );
      add_image_size( 'custom_thumb', 150, 150, true);
    }
    endif;
    add_action( 'after_setup_theme', 'my_theme_support' );
    
    add_filter( 'post_thumbnail_size', 'my_post_image_size' );
    function my_post_image_size( $size ) {
    	$size = 'custom_thumb';
    	return $size;
    }
    
    if (function_exists('add_filter'))
    add_filter( 'the_excerpt', 'excerpt_thumbnail' );
    function excerpt_thumbnail($excerpt){
        if(is_single()) return $excerpt;
        global $post;
        if ( has_post_thumbnail() ) {
            $img .= '<a href="'.get_permalink($post->ID).'">'.get_the_post_thumbnail($post->ID, 'custom_thumb').'</a>';
        } else {
            $img = '';
        }
        return $img.$excerpt;
    }

    Any other suggestions/possible solutions?
    That would be **much** appreciated.

  14. drwilson89
    Member
    Posted 2 years ago #

    Thank you. You know the finer points, I thought that the discussion was about a larger scale glitch that had impacted many. I will see if I can find some other thread that seems more relevant participants.

    Best regards.

  15. altfgcom
    Member
    Posted 2 years ago #

    Addendum:

    I've just tried installing the Auto Generate Thumbnails plugin to see if that'd help. It didn't.

    Instead of generating a thumbnail (150x150 as specified in functions.php), the featured image came out broken. The uploaded image was, once again, a full-sized image.

    This is driving me nuts...and it has become a serious problem because I've been refraining from uploading new posts with the full-sized thumbnails because they're dramatically slowing down the homepage (www.altfg.com) and several tag-archive pages.

    Also, I've noticed that even though I have "functions" set up to crop thumbnails to 150x150, those are being bypassed in the posts with full-sized thumbs. Remember, as I explain in my first post (see above) this issue began after my site was transferred from one hosting company to another this past Tuesday. Before that, everything was working just fine.

    Any suggestion on how I can solve this problem?? That'd be ***much*** appreciated.

  16. altfgcom
    Member
    Posted 2 years ago #

    For those who may one day run into this problem:

    A media library file (gd) was missing from the server and the php install.

    They've since performed the installation and thumbnails once again can be created. What a relief...

Topic Closed

This topic has been closed to new replies.

About this Topic