get featured image url
echo get_the_post_thumbnail_url();
wordpress get fiture image
if ( has_post_thumbnail()) {
$large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'large');
echo '<a href="' . $large_image_url[0] . '">';
the_post_thumbnail('thumbnail');
echo '</a>';
}
get featured image post wordpress by post id
<?php if (has_post_thumbnail( $post->ID ) ): ?>
<?php $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' ); ?>
<div id="custom-bg" style="background-image: url('<?php echo $image[0]; ?>')">
</div>
<?php endif; ?>
wp+get feature image
<?php
echo get_the_post_thumbnail( $post_id, 'thumbnail' );
?>
wordpress get post thumbnail
<?php
/* RETURNS a full image resource as: <img class="data..." src="data...">
ALL parameters are optional. Not needed if you are on WP LOOP
*/
echo get_the_post_thumbnail( $the_query->ID, array( 500, 400) );
/* USE get_the_post_thumbnail_url() to get only the image url */
?>
add featured image
function fn_add_featured(){
add_theme_support( 'post-thumbnails' );
add_image_size( 'post-imge', 730, 380 );
}
add_action('after_setup_theme','fn_add_featured');
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