0
votes

I am working in a custom theme in wordpress. One of the pages "solutions_page", displays all the post with category "solutions", with it featured image, the title and some text.

On top of the featured image, I need to add a circle with a picture of the author.

Here is my problem, I don't know where or how to do it. I was thinking I should put a div position absolute to the featured image, and then make it circle. But how can I do it if I do not have the featured image in code?

Here is my single.php, which it is not doing the job as I do not see my div for the picture:

<?php get_header(); ?>

<div class="container">
    <?php
    if (have_posts()) {
        while (have_posts()) {
            the_post();

            if (in_category('solutions')) {
                the_content();
                ?>
              <div class="authorCircle">
                <img src="images/jules.jpg" alt=""/>
              </div>
          <?php
          } else {
              the_content();
          }
      } // end while
  } // end if
  ?>
</div>
  <?php
  get_footer();

So authorCircle is the div I want to see in the content of the post with category "solutions".

Any ideas how can I do it? Should I put the div inside the_content()?

Thank you in advance!!

1
do you want other image when only featured image is present am i right ?? - Mayur Devmurari
not quiet. So, I want another image on top of the featured image (the avatar as kuldip Makadiya told me), showing the author picture. But because I set the featured image though the dashboard I don't know where to put the code to put the avatar too. Does it make sense? - eve_mf

1 Answers

1
votes

Please use this code it will display author avatar at your code.

<?php echo get_avatar( get_the_author_meta('ID'), 60); ?>

In above code respectivly you want get author id.