WordPress.org

Ready to get started?Download WordPress

Forums

How THis is work? (16 posts)

  1. ldmx
    Member
    Posted 6 years ago #

    Is install and upload a picture but a don't now how to display the picture???

  2. Weston Ruter
    Member
    Posted 6 years ago #

    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().

  3. teejay76
    Member
    Posted 6 years ago #

    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>

    <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 »'); ?>
    </p>

    </div>

    </div>

    <?php endwhile; ?>

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

    <?php else: ?>

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

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

    </div>

    <?php endif; ?>

    </div>

    <?php get_sidebar(); ?>

    <?php get_footer() ?>

    </div></body>
    </html>

  4. nclester
    Member
    Posted 6 years ago #

    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!

  5. teejay76
    Member
    Posted 6 years ago #

    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.

  6. markdw
    Member
    Posted 6 years ago #

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

  7. carlosterrym
    Member
    Posted 6 years ago #

    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%.

  8. carlosterrym
    Member
    Posted 6 years ago #

    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.

  9. carlosterrym
    Member
    Posted 6 years ago #

    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.

  10. Weston Ruter
    Member
    Posted 6 years ago #

    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:

    <?php
    $authordata = get_userdata(/*put desired user ID here*/);
    userphoto_the_author_photo();
    ?>

  11. clarkburbidge
    Member
    Posted 6 years ago #

    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() ?>

    </div>

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

  12. benz1
    Member
    Posted 6 years ago #

    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.

    Thanks,
    Benz1

  13. carlosterrym
    Member
    Posted 6 years ago #

    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 -->
    <?php
    if(isset($_GET['author_name'])) :
    $curauth = get_userdatabylogin($author_name);
    else :
    $curauth = get_userdata(intval($author));
    endif;
    ?>

    <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 -->

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

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

    </div>
    <?php get_footer(); ?>

  14. aeropause
    Member
    Posted 6 years ago #

    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">
    <!--single.php-->

    <!--loop-->
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <!--navigation-->

    <!--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">
    </div>
    <!--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">
    </div>
    <!--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-->
    </div>
    <!--include footer-->
    <?php get_footer(); ?>

  15. MKatLarge
    Member
    Posted 5 years ago #

    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!

  16. dpstud
    Member
    Posted 5 years ago #

    This one helped me a bunch:

    http://wordpress.org/support/topic/198086

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags