Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #24618

    i was looking into the idea of changing my theme from velvet to another theme, not necessarily a kriesi theme (much as i like them). i was experimenting, and none of my images, which are ‘set as featured images,’ appeared as i ‘previewed’ other themes. is this true? is there anything i can do about this?? that would be years of daily photos….

    thank you!

    courtney

    #124071

    You can try following convert function. Backup your database first and then insert the code at the end of functions.php:

    add_action( 'admin_init', 'avia_do_gallery_conversion');

    function avia_do_gallery_conversion()
    {
    $post_types = array('post','page','portfolio');
    $count = 0;

    //iterate over each post type
    foreach($post_types as $type)
    {
    //get all posts of a certain type
    $the_query = new WP_Query( array('post_type' => $type, 'posts_per_page'=>-1) );

    //check if any post were retrieved
    if(!empty($the_query->posts))
    {
    //iterate over each post and check if the post has a gallery key
    foreach($the_query->posts as $entry)
    {
    //since there might be hundreds of posts make sure php doesnt time out
    @set_time_limit(45);

    $post_id = $entry->ID;

    $slides = avia_post_meta($post_id, 'slideshow');

    if(isset($slides[0]['slideshow_image']))
    {
    $attachmend_id = $slides[0]['slideshow_image'];

    if(is_numeric($attachmend_id))
    {
    update_post_meta($post_id, '_thumbnail_id', $attachmend_id);
    }
    }
    }

    }
    }
    }

    Afterwards go to your admin page – it will probably load very long because this code will query all posts and it will set the first slideshow image as featured image. After the conversion remove the code to avoid performance issues.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘if i were to wish to change my theme — to the 'featured image' images follow me’ is closed to new replies.