Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: first blank thumbnail in media-library

Discussion in 'Misc WordPress Requests' started by arsenalemusica, Oct 12, 2017.

  1. arsenalemusica

    Guest

    Reply To: first blank thumbnail in media-library, by arsenalemusica

    I was following this tutorial and inserted the following code:

    / get all posts from blog
    $query = new WP_Query(
    array(
    'post_type' => 'blog',
    'posts_per_page' => -1,
    )
    );
    $all_posts = $query->posts;
    foreach ($all_posts as $one_post)
    {
    $value = get_field('blog_image', $one_post->ID);

    if ($value != '')
    {
    $thumbnail_id = $value['id'];
    update_post_meta($one_post->ID, '_thumbnail_id', $thumbnail_id);
    }
    }

    Reply To: first blank thumbnail in media-library
     
    #1

Share This Page

Web Hosting