Featured Image Wordpress

1

Hello! I have the following problem, I am building a theme and the page where the posts are added is not the index.php, so that the posts appeared I had to put <?php query_posts(''); ?> in the loop, it worked normally, but the functionality ) that exists in the ADM panel, is gone, but when I activate some other default wordpress theme, this option appears again. Any solution? Thanks!

/* ativa post thumbnails e especifica padrão para tamanho de imagem */ add_theme_support('post-thumbnails'); add_image_size('690x300', 690, 300, True);

    
asked by anonymous 07.07.2017 / 14:18

1 answer

0

Inside your loop, you should call the the_post_thumbnail_url() function. It returns the url of the highlighted image of the current post. Here in the documentation you can see more about this function and its variations.

A simple example of using the function:

<div class="blog-post">
    <div>
        <figure>
            <img src="<?php the_post_thumbnail_url(); ?>" alt="<?php echo the_title(); ?>">
        </figure>
    </div>
</div>
    
07.07.2017 / 14:39