How to list only the highlighted image of a post?

2

How can I show on my page only the highlighted images, without titles and description on my page?

This is my structure:

<?php

    $args = array( 'posts_per_page' => 1, 'category_name' => 'primeiro-conceito' );
        $myposts = get_posts( $args );
        foreach ( $myposts as $post ) : setup_postdata( $post );
            $com_number = get_comments_number( $post->ID );
            $post_thumb_id = get_post_thumbnail_id( $post->ID );
            $post_thumb_src = wp_get_attachment_image_src( $post_thumb_id, '800x850' );
?>

    <div id="posts-conceitos">
        <a href="<?php echo get_permalink( $ultima->ID ); ?>"><img class="img-responsive margin-bottom-10" src="<?php echo $post_thumb_src[0]; ?>"></a>


        <?php the_excerpt(); ?>
    </div>
    
asked by anonymous 01.12.2015 / 19:05

1 answer

2

You can do it this way:

<?php
$thumb_id = get_post_thumbnail_id();
$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail-size', true);
echo $thumb_url[0];
?>

Make sure you change the thumbnail-size to the sizes specified below to modify the size of the images.

The standard sizes available are - thumbnail , medium , large and full .

    
01.12.2015 / 21:14