0

I am looking to build a custom WordPress blog which is simple enough but I have a requirement I need to meet.

On each blog post on the index.php page I want to display the authors name and image. The authors name will link off to the authors own page which details there bio and all there posts.

I also need to show the authors bio at the bottom of every single.php post he posts. I am unsure of how to go about this if anyone has any ideas.

Thanks

  • 1
    What have you coded so far? Please post your work and explain why it doesn't work. – Brad Dalton Feb 12 '15 at 13:48
  • Please post the relevant code from index.php and single.php. The Loop from each should be sufficient. – David Gard Feb 12 '15 at 13:51
0

I can't give you an exact contextual answer because you have not provided your code, however the functions (with example usage) listed below should do what you require.

On each blog post on the index.php page I want to display the authors name and image.

Inside The Loop you can get the name of the author by using the_author_meta(), you can get the image by using get_avatar() and you can get the link to the authors page by using get_author_posts_url() -

<a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?>">
    <?php
    echo get_avatar(get_the_author_meta('ID'));
    the_author_meta('display_name');
    ?>
</a>

I also need to show the authors bio at the bottom of every single.php post he posts.

Once again this is done inside The Loop. You can also use get_the_author_meta() -

echo get_the_author_meta('description');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.