Why image Thumbnail url is not displaying with custom size?
-
The website has only one thumbnail size 375×211. I want to show this size thumbnail image at site homepage so that when I copy this image it only copies in 375×211 size, not in full image size which is 728×410
The following code will produce an img tag with the content.php present:
<?php $defalt_arg =array('class' => "img-responsive"); ?> <?php if(has_post_thumbnail()): ?> <a href="<?php the_permalink(); ?>"> <?php the_post_thumbnail('', $defalt_arg); ?> </a>
Custom size in funtion.php
add_theme_support( 'post-thumbnails' ); add_image_size( 'img-responsive', 375, 211, true );
Here is the image source code:
<img src="/uploads/2018/09/Transportation-Access.jpg" class="img-responsive wp-post-image" srcset="uploads/2018/09/Transportation-Access.jpg 728w, /uploads/2018/09/Transportation-Access-375x211.jpg 375w" sizes="(max-width: 728px) 100vw, 728px" width="728" height="410">
Please help me understand what I am doing wrong! I think the problem is in src=”/uploads/2018/09/Transportation-Access.jpg” which is not showing like /uploads/2018/09/Transportation-Access-375×211.jpg
The page I need help with: [log in to see the link]
- The topic ‘Why image Thumbnail url is not displaying with custom size?’ is closed to new replies.