wordpress obține URL-ul miniatură post
<?php
// ALL parameters are optional. Not needed if you are on WP LOOP
echo get_the_post_thumbnail_url( $the_query->ID, array( 500, 400) ); ?>
obțineți url-ul imaginii recomandate în wordpress
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>';
}
arată imaginea prezentată în 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 } ?>
obțineți URL-ul imaginii recomandate
echo get_the_post_thumbnail_url();
wordpress recomandate imagine arată
<?php echo the_post_thumbnail(); ?>
obțineți ID-ul de imagine prezentat wordpress
get_post_thumbnail_id($post)