wordpress thumbnail url
<img src='<?php the_post_thumbnail_url(); ?>'>
wordpress thumbnail url
<img src='<?php the_post_thumbnail_url(); ?>'>
show featured image in post wordpress
<?php if(has_post_thumbnail()){
the_post_thumnbail('cstm_name', array( 'class' => 'class1 class2' ))
} else { ?>
<img class="card-img-top" src="http://placehold.it/750x300" alt="Card image cap" class="img-responsive">
<?php } ?>
wordpress thumbnail image with picture tag html
<?php
// Get this attachment ID
$attachment_id = get_post_thumbnail_id( $post_id );
$image_large_src = wp_get_attachment_image_src( $attachment_id, 'large' );
?>
<picture>
<!-- Large art direction resolutions -->
<source media="(min-width: 50rem)"
srcset="<?php echo wp_get_attachment_image_srcset( $attachment_id, 'large' ); ?>"
sizes="(min-width: 60rem) 60rem, 100vw">
<!-- Small art direction resolutions -->
<source
srcset="<?php echo wp_get_attachment_image_srcset( $attachment_id, 'large-cropped' ); ?>"
sizes="100vw">
<!-- fallback -->
<img src="<?php echo $image_large_src[0]; ?>"
srcset="<?php echo wp_get_attachment_image_srcset( $image_large_id, 'large' ); ?>"
sizes="(min-width: 60rem) 60rem, 100vw"
alt="<?php get_post_meta( $attachment_id, '_wp_attachment_image_alt', true) ?>"
>
</picture>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us