Support » Fixing WordPress » How THis is work?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Edit your template inside of the posts loop, and insert either the template tag userphoto_the_author_photo() or userphoto_the_author_thumbnail().

    Inside of the comments loop, insert either userphoto_comment_author_photo() or userphoto_comment_author_thumbnail().

    I need more lament instructions – I am sorry.

    I am assuming this is the Post Loop (index.php page?) you are talking about, but where exactly does or userphoto_the_author_thumbnail() go in the code?

    <?php get_header(); ?>

    <div id=”container”>

    <?php if(have_posts()): ?><?php while(have_posts()):the_post(); ?>

    <div class=”post”>

    <h2>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>

    <div class=”postinfo”>
    <?php _e(‘Posted on’); ?> <span class=”postdate”><?php the_time(‘F jS, Y’) ?></span> <?php _e(‘by’); ?> <?php the_author() ?>

    <div class=”entry”>

    <?php the_content(); ?>

    <p class=”postmetadata”>
    <?php _e(‘Tags:’); ?> <?php the_category(‘, ‘) ?> <?php edit_post_link(‘Edit’, ‘ | ‘, ”); ?> // <?php comments_popup_link(‘Add Comment »’, ‘1 Comment »’, ‘% Comments »’); ?>



    <?php endwhile; ?>

    <div class=”navigation”>
    <?php posts_nav_link(); ?>

    <?php else: ?>

    <div class=”post” id=”post-<?php the_ID(); ?>”>

    <h2><?php _e(‘Not Found’); ?></h2>


    <?php endif; ?>


    <?php get_sidebar(); ?>

    <?php get_footer() ?>


    Download the YAPB (Yet Another PhotoBlog), it’s quick and easy. Plus you can add single photos to your posts right from your desktop, totally eliminating the need for third-party software. (ftp client)

    Good luck!

    Thank you nclester…I am going to attempt this one though…after studying the code much closer I figured it out – the only problem I am having now is when I upload another users photo, after puting the code in the comments loop as it states above, the other users thumbnail is showing up as my own thumbnail, not theirs…so not sure what i am doing wrong on that one.

    Where did you put it please because I cannot get it to appear?

    I’m having the same issue as teejay76. I have 2 authors on my blog, both pictures (.jpg) have been uploaded, but the same picture displays when we look at either author’s page.
    Any help is appreciated. By the way this has been the easiest author image plugin to implement, now if I could only get it working 100%.

    I inserted the template tag userphoto_the_author_photo() in my author.php file outside of the loop and the same .jpg displays for all users. When I place it inside the loop, the correct picture displays, but it shows up as many times as the author has posts.

    Try this outside of the loop in author.php

    ‘ <!– My Loop –> ‘
    ‘ <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> ‘
    ‘ <?php endwhile; else: ?> ‘
    ‘ <?php endif; ?> ‘
    ‘ <?php echo userphoto_the_author_photo(); ?> ‘
    ‘ <!– My Loop –> ‘

    It is not the cleanest but it works for me.

    Remember that $authordata must be set for the template tags to work. The last comment by carlosterrym sets $authordata, and that is why it works. But it is better to do something like:

    $authordata = get_userdata(/*put desired user ID here*/);

    That is very static. How about some example code that will work for every comment user automagically. What and where do I put here? From the K2 comments.php.

    <li class=”<?php /* Style differently if comment author is blog author */ if ($comment->comment_author_email == get_the_author_email()) { echo ‘authorcomment’; } ?> item” id=”comment-<?php comment_ID() ?>”>
    <?php if (function_exists(‘gravatar’)) { ?><img src=”<?php gravatar(“X”, 32, “”); ?>” class=”gravatar” alt=”Gravatar Icon” /><?php } ?>
    ” class=”counter” title=”Permanent Link to this Comment”><? echo $count_pings; $count_pings++; ?>
    <span class=”commentauthor” style=”font-weight: bold;”><?php comment_author_link() ?></span>
    <?php if ( $user_ID ) { edit_comment_link(‘<img src=”‘.get_bloginfo(template_directory).’/images/pencil.png” alt=”Edit Link” />’,'<span class=”commentseditlink”>’,'</span>’); } ?>
    <small class=”commentmetadata”>” title=”<?php if (function_exists(‘time_since’)) { $comment_datetime = strtotime($comment->comment_date); echo time_since($comment_datetime) ?> ago<?php } else { ?>Permalink to Comment<?php } ?>”><?php comment_date(‘M jS, Y’) ?> at <?php comment_time() ?></small>

    <div class=”itemtext”>

    <?php comment_text() ?>


    <?php if ($comment->comment_approved == ‘0’) : ?>
    <p class=”alert”>Your comment is awaiting moderation.</p>
    <?php endif; ?>

    Would it be possible for someone that has managed to get this to work successfully to post an example of the post loop from their index.php including the addiitonal line of code?

    I’ve tried adding userphoto_the_author_thumbnail() to various places in the loop but all it get are the words userphoto_the_author_thumbnail() appearing on the page, no photos.


    I got this to work in Author.php. This is what my author.php looks like. Hope it helps. (My apologies if I’m not supposed to post code here)

    <?php get_header(); ?>

    <?php get_sidebar(); ?>
    <div id=”content” class=”narrowcolumn”>
    <!– This sets the $curauth variable –>
    if(isset($_GET[‘author_name’])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));

    <h2>Autor: <?php echo $curauth->nickname; ?></h2>
    <!— <?php echo userphoto_the_author_photo(); ?> –>

    <!– The Loop0 –>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php endwhile; else: ?>
    <?php endif; ?>
    <?php echo userphoto_the_author_photo(); ?>
    <!– End Loop0 –>

    <dd><?php echo $curauth->user_description; ?></dd>

    <h2>Publicado por <?php echo $curauth->nickname; ?>:</h2>

    <?php get_footer(); ?>

    I’m finding this too difficult to setup author and commenters photos in the single page. Here is my code I’m hoping someone can modify it to show me where the tags go plus adding the “$authordata” as I have no idea where that goes. I would really appreciate it:

    <?php get_header(); ?>
    <!–include sidebar–>
    <?php include(TEMPLATEPATH.”/l_sidebar.php”);?>
    <!–include sidebar–>
    <?php include(TEMPLATEPATH.”/r_sidebar.php”);?>
    <div id=”content”>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    <!–post title–>
    <h1 id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”Permanent Link: <?php the_title(); ?>”><?php the_title(); ?></h1>
    <p><b>By <?php the_author(); ?></b> | <?php the_time(‘F j, Y’); ?> <span style=”color:#999999″><?php if(function_exists(‘the_views’)) { the_views(); } ?></span></p>
    <div class=”postspace2″>
    <!–content with more link–>
    <?php the_content(‘<p class=”serif”>Read the rest of this entry »</p>’); ?>
    <!–for paginate posts–>
    <?php link_pages(‘<p>Pages: ‘, ‘</p>’, ‘number’); ?>
    <p><b>Topics:</b> <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    <div class=”postspace”>
    <!–all options over and out–>
    <!–include comments template–>
    <?php comments_template(); ?>
    <!–do not delete–>
    <?php endwhile; else: ?>
    Sorry, no posts matched your criteria.
    <!–do not delete–>
    <?php endif; ?>

    <!–single.php end–>
    <!–include footer–>
    <?php get_footer(); ?>

    I have read all of this and am still clueless…!
    I have the plugin uploaded, and installed.
    I created the writable directory for it.
    Photos are uploading, and show in the user’s profile.

    But how to make them show in posts and comments?
    What and where is the “posts loop”?
    If someone could please just give me step by step newbie instructions to make the author’s avatar show in their posts and comments!

    This one helped me a bunch:

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How THis is work?’ is closed to new replies.