Display Wordpress Author Photo along with post without plugin
Multiple authors can display photo’s with post
This really cool to display photo on website, most of blog owners want to be model but by bad luck writing blog post, so they want to display their photos along with post.:D lol.
i was kidding, to display photos gives a great and cool look to blog, and by this multiple author can write post together. there are some plugins to display photos, but here im giving you simple and cool way to display photo, icon or avtaar with posts.
Get ready to make some changes in your post here we go
<?php while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2><a href=”<?php the_permalink() ?>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></a></h2>
<small><?php the_time(’F jS, Y’) ?> <!– by <?php the_author() ?> –></small>
Replace “<!– by <?php the_author() ?> –>” by below codes.
<img src=”<?php bloginfo(’template_directory’) ?>/images/<?php the_author()?>.jpg” alt=”<?php the_author(); ?>” title=”<?php the_author(); ?>” />Â /// display photo with author names, remember author names can be same so try id ;
or
<img src=”<?php bloginfo(’template_directory’) ?>/images/<?php the_author_ID()?>.jpg” alt=”<?php the_author(); ?>” title=”<?php the_author(); ?>” />
<?php bloginfo(’template_directory’) ?>/images/Â Â /// this is path of your photo you can change it as per your requirement.















July 10th, 2009 at 9:30 pm
well not a perfect solution
January 28th, 2010 at 2:45 pm
Hey this is one smart, plug-in free solution.
Thanks!
February 14th, 2010 at 5:49 pm
Nice solution.
November 4th, 2010 at 2:28 pm
Why not just use Gravatar?
http://wpengineer.com/505/identify-authors-gravatars/