![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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 | |
|
|
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 |
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us