Migrating problem – featured images

I’m trying to migrate a WP install using default export and import tool. Everything is peachy except featured images.

For my post thumbnails I’m using default Featured Image option with 7-8 predefined image sizes in my functions.php.

Read More

Problem – after importing, WordPress is just putting original picture in img src for thumbnail. Not resized one as is should be, but largest one which was uploaded originally.

This is not even an option, because there are over 2000 posts, but I can’t even fix this by setting featured image again by selecting image from media library — I have to upload the image again, and then it works.

I guess import/export tool doesn’t save all the settings/metadata it should, but I can’t figure out how to solve this.

Image files (original and resized ones) are on server and in proper folder, and code is set up properly as well.

Related posts

Leave a Reply

1 comment

  1. The_post_thumbnail is a function that “runs” on the “theme” side of things.. not the DB.

    in short – you need to have a theme that supports post thumbnails .
    That means , to have it work – you need the SAME theme when migrating to be functional , OR adapt the new one.

    Open your functions.php on your theme, and search for something like :

    add_theme_support( 'post-thumbnails' ); //thumnails
    set_post_thumbnail_size( 230, 150, true ); // Normal post thumbnails
    

    AND the following :

    //add_image_size( 'single-post-thumbnail', 400, 9999 ); // Permalink thumbnail size choose one !
    add_image_size( 'single-post-thumbnail', 400, 300,true ); // single-post-test
    add_image_size( 'tooltip', 100, 100, true ); // Permalink thumbnail size
    add_image_size( 'nivo', 470, 350, true ); // nivo slider size
    

    note that the names and size in your theme will be different.

    If you do not have it on your OLD, you will need to copy that from your OLD theme´s functions.php , to your NEW theme – along with the proper the_post_thumbnail_(arg) that appear on your theme files (like single.php, archives.php etc..)

    The simplest way (if you are a beginner in WP) is to activate the old theme on the new migration site and see if all works..

    Also – check that the folder structure, permalink structure AND folders/files naming are all the same..