I currently have a form in my wordpress backend showing a list of posts with their thumbnail.
However when I inspect the source, I see that all the URLs for the images start with 2 forward slashes before the domain.
This is a pain because I am sending this list of posts in an email via wp mail
and with that URL being the way it is, it's obviously looking for a local image at the other end.
<?php
if( has_post_thumbnail() ) {
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
echo '<img src="' . $thumb_url[0] . '"/>';
} else { ?>
<img src="<?php echo get_site_url(); ?>/wp-content/plugins/scp-bookings/custom/images/hotel-512.png" width="150" height="150" >
<?php } ?>
I need to show the full URL (removing the //
before the url).