Customize post thumbnail size

Hi,
I watched this whole series “Building WordPress Themes With Bootstrap”. It was very interesting. I have one question I want to make my post thumbnail size 1200 x 300. I tried everything but could not achieve this size. I changed in admin thumbnail size but no luck. I put some custom code according to codex however no luck.

I am creating a slide show with flexslider for my post and want to be clickable and open and new window with magnific pop gallery. so I want slider 1200 x 300 and when user click on one of slide image should show full in new gallery window.

this is my code

function add_flexslider() { // display attachment images as a flexslider gallery on single posting

global $post; // don't forget to make this a global variable inside your function

$attachments = get_children(array('post_parent' => $post->ID, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_type' => 'attachment', 'post_mime_type' => 'image', ));

if ($attachments) { // if there are images attached to posting, start the flexslider markup

    echo '<div class="flexslider">';
    echo '<ul class="slides">';

    foreach ( $attachments as $attachment_id => $attachment ) { // create the list items for images with captions

$img_source = wp_get_attachment_image_src( $attachment_id, 'large' );

echo '<li>';
echo '<a href="'.$img_source[0].'">';
echo wp_get_attachment_image($attachment_id, 'thumbnails');
echo '</a>';
echo '<p>';
echo get_post_field('post_excerpt', $attachment->ID);
echo '</p>';
echo '</li>';

}
echo ‘’;
echo ‘’;

} // end see if images

} // end add flexslider

can any one help me with this I will appreciate.

Hi, did you see this? https://developer.wordpress.org/reference/functions/add_image_size/

try var_dump($attachments); to se what you can get