• Resolved skippix

    (@skippix)


    I’m trying to write a work-around for the broken wordpress import plugin (it imports images, but does not process the parent id field) and am looking for where the post thumbnails are defined in the database. I have the sql to fix the parent id, but need the sql to make the first image associated with a post the “featured image”.

    Any direction/sql would be greatly appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter skippix

    (@skippix)

    Found it!

    It’s in the wp_postmeta table

    If one is already defined, then
    UPDATE your_database.wp_postmeta SET meta_value = ‘[the wp_post.ID value of the gallery image]’ WHERE wp_postmeta.post_id = [the wp_post.ID value of the post] and wp_meta_key=’_thumbnail_id’;

    If you are inserting one then
    INSERT INTO your_database.wp_postmeta (meta_id, post_id, meta_key, meta_value) VALUES (NULL, ‘[the wp_post.ID value of the post]’, ‘_thumbnail_id’, ‘[the wp_post.ID value of the gallery image]’);

Viewing 1 replies (of 1 total)
  • The topic ‘Looking for the post thumbnail’ is closed to new replies.