Help Fallback (thumbnail)

This should work

global $post;

$html = "";

$my_latest_posts_widget = new WP_Query( array(
     'post_type' => 'post',
     'posts_per_page' => 3
));
$html .= '<div id="container_recent_posts_widget" class="container_recent_posts_widget">';

if( $my_latest_posts_widget->have_posts() ) : while( $my_latest_posts_widget->have_posts() ) : $my_latest_posts_widget->the_post();

  $thumb = get_template_directory_uri() .'/assets/images/default-image-post-thumbnail-widget.jpg';
  if ( has_post_thumbnail() ) {
    //override  fallback image if post has any thumbnail
    $thumb = get_the_post_thumbnail_url();
  }

 $html .= '<div class="recent_posts_widget_post">';
 $html .= '<a href="https://wordpress.stackexchange.com/questions/286059/" . get_the_permalink() ."https://wordpress.stackexchange.com/questions/286059/"><div><img class="attachment-blogthumbhomewidget size-blogthumbhomewidget wp-post-image" src="' .

$thumb

  . '" alt="' .get_the_title(). "https://wordpress.stackexchange.com/questions/286059/"https://wordpress.stackexchange.com/questions/286059/" .get_bloginfo(). '"/></div></a>';
 $html .= '<a href="https://wordpress.stackexchange.com/questions/286059/" . get_the_permalink() ."https://wordpress.stackexchange.com/questions/286059/"><h2 class="recent-posts-widget-title">' . get_the_title() . '</h2></a>';
 $html .= '<a href="https://wordpress.stackexchange.com/questions/286059/" . get_the_permalink() ."https://wordpress.stackexchange.com/questions/286059/"><p class="recent-posts-widget-text">' . excerpt(20) . '</p></a>';
 $html .= '<div class="lees-meer-post-div"><a class="lees-meer-post-a" href="https://wordpress.stackexchange.com/questions/286059/" . get_the_permalink() ."https://wordpress.stackexchange.com/questions/286059/"><span class="lees-meer-post-widget">Lees meer</span></a></div> ';
 $html .= "</div>";
endwhile; endif;

echo '</div>';

return $html;

tech