ThemeShaper Forums » Thematic

[closed]

Beginner: Position Author Avatar in Post (Child Theme)

(6 posts)
  • Started 2 years ago by greifj
  • Latest reply from helgatheviking
  • This topic is resolved
  1. greifj
    Member

    I'm a designer, trying to branch into Child Themes, so bear with me...

    I'd like to add an Author Avatar to each post, and position it to the left of the Post Title. I've got the Avatar covered...I just don't know where to find the code to drop it into the Post in the right place.

    How would one modify the layout of an individual post using a Child Theme?

    Appreciate your time.

    Posted 2 years ago #
  2. i think you could filter the postheader

    function child_postheader($postheader){
       $postheader = 'avatar' . $postheader;
       return $postheader;
    }
    add_filter('thematic_postheader', 'child_postheader' );
    Posted 2 years ago #
  3. greifj
    Member

    Hey, thank you, Helga!
    How did I know it would be you that would respond? :)
    You are everywhere.

    I am struggling to figure out the correct format to use when replacing 'avatar' with my avatar code:
    <?php echo get_avatar( get_the_author_email(), '37' ); ?>

    Any suggestions?

    Posted 2 years ago #
  4. greifj
    Member

    So...to update...
    I've got the image appearing, but can't get it to line up to the left of the post title.

    As you can see here, it's still above...
    http://mediumbird.com/

    Posted 2 years ago #
  5. greifj
    Member

    Apologies...using your help, Helga, I've figured it out.

    Combining your function with my new-found knowledge of the css property 'clear'...
    I got it sorted.

    Thank you, Helga!

    Posted 2 years ago #
  6. you're welcome. also, since you are 'returning' a value when using filters you don't want to simultaneously use 'echo'. echo spits it out as soon as it encounters what you are echoing... so it might be your avatar code is not being outputted in the right place.

    function child_postheader($postheader){
       $postheader = get_avatar( get_the_author_email(), '37' ) . $postheader;
       return $postheader;
    }
    add_filter('thematic_postheader', 'child_postheader' );
    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.