Community Forums › Forums › Design Tips and Tricks › Positioning an author gravatar near a post title
Tagged: gravatar, gravatar positioning
This topic contains 22 replies, has 5 voices, and was last updated by lliillaa 5 months, 2 weeks ago.
-
AuthorPosts
-
December 10, 2012 at 8:40 am #4160
Cool. So I’m not telling you anything new. Thanks again for your guidance. It is much appreciated.
December 30, 2012 at 5:42 pm #8477I really want to do this. Area you saying the only way you could figure it out is to buy and use Thesis instead of Genesis. I’m pretty new at WordPress and need a little more assistance. Is this possible to do?
December 30, 2012 at 5:54 pm #8480Debs linked to a tutorial, but you may not have access to it, so I’ve taken the liberty of including this here:
http://www.studiopress.com/support/showthread.php?t=82871&highlight=author+gravatar+post+title
From user AnoopSudhakaran on the old forum
Paste the following code in functions.php of your Child Theme to enable the Gravatar in the Post Title on all pages (Single Post,Homepage etc.):
Note: Change the 25 to the size of Gravatar you want.
function title_avatars() { ?>
<div id=”avatar-title”>
<?php echo get_avatar( get_the_author_id() , 25 ); ?>
</div>
<?php }
add_action(‘genesis_post_title’, ‘title_avatars’);If you would like to add it only on the Homepage then use this code:
function title_avatars() {
if (is_home())
{ ?>
<div id=”avatar-title”>
<?php echo get_avatar( get_the_author_id() , 25 ); ?>
</div>
<?php } }
add_action(‘genesis_post_title’, ‘title_avatars’);If you want to get Gravatar only on Single Pages:
function title_avatars() {
if (is_single())
{ ?>
<div id=”avatar-title”>
<?php echo get_avatar( get_the_author_id() , 25 ); ?>
</div>
<?php } }
add_action(‘genesis_post_title’, ‘title_avatars’);Style it using CSS
#avatar-title {CSS HERE} [Tip : Use Firebug to edit in realtime]
Susan @ Graphically Designing I’d love to customize your website! I tweet!
I’ve taken up the challenge! – help me answer some of the unanswered postsDecember 31, 2012 at 8:37 am #8592Thank you for the follow up on this topic Susan. It is much appreciated and very helpful for any future projects that may require Genesis.
December 31, 2012 at 10:35 am #8601Thank you for copying and pasting the information, but just to be certain, I actually manually add this to the bottom of the functions.php file of the child theme even though it states at the top of the file not to make changes to it under any circumstances? I can’t add it using the Custom Code portion of the Genesis settings?
December 31, 2012 at 10:36 am #8602Oops, one more thing. I don’t understand the “style it using CSS. Where do I put that code?
December 31, 2012 at 12:35 pm #8616lliillaa - do you have the Prose theme? That’s the only theme where you wouldn’t plug it directly into your functions file – that theme is set up differently than the other themes.
Susan @ Graphically Designing I’d love to customize your website! I tweet!
I’ve taken up the challenge! – help me answer some of the unanswered postsDecember 31, 2012 at 1:14 pm #8617Yes, I have the Prose theme.
-
AuthorPosts
You must be logged in to reply to this topic.