WordPress.org

Ready to get started?Download WordPress

Forums

Custom field image to Featured image issue (5 posts)

  1. divyang.jp
    Member
    Posted 2 years ago #

    Hi,
    My current theme uses custom field for image thumbnails (custom field key is 'image'). Now I want to start using new theme which supports wordpress' featured image feature as the theme supports version 2.9+.

    I want to migrate all the custom field images to featured image and resize them to new thumbnail sizes as per the new theme requirement.

    I tried using "Regenerate Thumbnails" plugin but it resizes all the images attached to all the posts. I just want to resize featured images to new thumbnail size.

    So basically I want,
    1) Convert custom field image to featured image.
    2) Resize all the featured images to new dimensions.

    Regards,
    Divyang Patel

  2. Matic
    Member
    Posted 2 years ago #

    I doubt you'll get some plugin to do that (convert custom field image to featured image) but I think you can do that very easily with SQL (in phpmyadmin for example):

    UPDATE wp_postmeta
    SET meta_key = '_thumbnail_id',
    WHERE meta_key = 'image';

    *NOTE: backup your database first!

  3. archiseek
    Member
    Posted 2 years ago #

    oh i need to do this
    however your syntax gives an error
    any idea?

  4. archiseek
    Member
    Posted 2 years ago #

    update [table_name] set [field_name] = replace([field_name],'[string_to_find]','[string_to_replace]');

    used this to rename my thumbs field but still not showing up

  5. Seren-IT
    Member
    Posted 2 years ago #

    I had to do a similar thing - convert and resize images from custom fields.

    There are a couple of plugins to convert custom field image to featured image:
    Auto Featured Image
    and Auto Post Thumbnails, which is the one I used.

    There are also plugins for resizing images in your media library. I use AJAX Thumbnail Rebuild

    If your original custom field images are not in your media library, you might need to use this first:
    Add from Server

    And this is a further great plugin for handling images throughout your site (especially for displaying different sizes):
    Get the Image

Topic Closed

This topic has been closed to new replies.

About this Topic