StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 04-06-2009, 09:03 AM
mikewilltoo mikewilltoo is offline
Registered User
Pro Plus Member
 
Join Date: Mar 2009
Posts: 133
Default coding changes for avatars

Sorry to be such a pest with questions. Once I get over the hump with this theme they'll stop. Anyway,

I'm trying to get avatars to appear in posts (and eventually, comments). I thought it wouldn't be all that complicated. I'm trying a plugin, add-local-avatar. Installs OK. Avatars uploaded. Now the coding. The relevant instructions are:

Put this code in your template files where you want avatars to appear:

<?php echo get_avatar(); ?>

The function takes the following parameters:

1. Identifier; A blog user ID, an e-mail address, or a comment object from a WordPress comment loop (for comments).
2. Size (pixels); defaulted to value set above.
3. Default image if no Global (public) or Local (private) avatar found; defaulted to value set above.

Apply format to the avatars with something like the following in your style.css theme file:

* For comment avatars, .avatar { float: left; padding: 2px; margin: 0; border: 1px solid #ddd; background: white; }
* For avatars in post content, .post_avatar { padding: 2px; margin: 0; border: 1px solid #ddd; background: white; }

Examples for your theme's template files:

* In single.php declare <?php global $post; ?> if not already declared and then use <?php get_avatar($post->post_author); ?> to show the post author's avatar.
* Inside the comment loop of comments.php use <?php get_avatar($comment); ?> to show the comment author's avatar.


I inserted the code <?php get_avatar($post->post_author); ?> in page_blog.php after the breadcrumb and ahead of the title, but that, or that by itself, did nothing.

I also can't make out where exactly to put the formatting in style.css.

I'd appreciate any suggestions. This looks like pretty serious coding, certainly over my head (although I can follow instructions), so if the response is "leave it to the pros" I understand. THANKS.
__________________
-------------------------------------
Configuration:
Windows 7
WordPress 3.4.1
Genesis 1.8.2
Site: hhttp://www.matthaag.com/ [live]
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Avatars are all appearing as generic gray HollyKNY General Discussion 6 02-16-2011 01:26 PM
(Gr)avatars johnmaar General Discussion 2 02-13-2009 09:06 PM
Allowing avatars, instead of stars, for comments list howtofeelhappier General Discussion 1 11-19-2008 05:38 AM


All times are GMT -5. The time now is 10:38 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.