**Situation**<br>
I've created a Custom Post Type called 'Banners'. On each post I'm able to add a featured image. This will be saved in my database and will get an **_thumbnail_id**. Also on each post edit page, there is a custom meta box for the banner_url and the target attribute. There I give my banner the link where it should go after clicking on it on the frontend. And the target attribute will open the image in the correct way. This will be correctly send to my wpdb. 

Plugin code:

    <?php
    // function to show a banner using query of banner post type
    function show_banner() {

    // start by setting up the query
    $get_banner = new WP_Query( array(
      'post_type' => 'banners',
      'meta_query' => array(
        'relation' => 'AND',
        array(
          'key' => 'banner_link',
          'value' => 'https://www.mypage.com'
        )
      )
    ));


    // now check if the query has posts and if so, output their content in a banner-box div
    if ( $get_banner->have_posts() ) : while ( $get_banner->have_posts() ) : $get_banner->the_post();

    $output = '<div class="container" align="center"><a href="'.get_post_meta( get_the_ID(), 'banner_link', true ).'"
    target="'.get_post_meta( get_the_ID(), 'target', true).'">'.get_the_post_thumbnail().'</a></div>';

     endwhile;
    endif;
    wp_reset_postdata();
    return $output;
    }

    add_shortcode( 'banner', 'show_banner' );
    //END
    ?>

Page.php

    <?php  echo do_shortcode("[banner]");?>
**Question**<br>
I use a meta_query to select the url. It works perfectly and displays the correct image. Also the link and target works fine. But what I want is that
I can add a thumbnail_id to the do_shortcode echo and then the correct image is displayed on the frontend with the right url and target around it.

I hope someone can help me in the right direction. Thanks in advance.