How to show a thumbnail of a circular wodpress post?

Asked

Viewed 52 times

1

I’m trying to show the image of the post wordpress in rounded shape, what would be the best way? It is returned through the function "the_post_thumbnail()" wordpress. Can someone help me?

<?php
 $postslist = get_posts('numberposts=2&order=DESC&orderby=date');
 foreach ($postslist as $post) :
 setup_postdata($post);
 ?>

 <?php static $count1 = 0; if ($count1 == "2") { break; } else { ?>
 <div class="post">
     <div class="imgwrap">
         <?php the_post_thumbnail(); ?>
     </div>
</div>
  • Uses border-Radius from css man... just like the bass brother quoted.

1 answer

5

Through CSS. If you are allowed to use the file, change the class imgwrap that surrounds the image.

Put a:

.imgwrap{
     border-radius: 50%;
}
  • I managed to solve, I applied your tip directly to img, thank you.

  • That’s right. If it were div, I forgot to tell you you had to put a overflow:hidden.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.