Forums

[resolved] (Plugin: User Photo) Author.php (10 posts)

  1. dillouz
    Member
    Posted 3 years ago #

    How can I add the user photo to author.php? This is important.

    http://wordpress.org/extend/plugins/user-photo/

  2. @mercime
    Member
    Posted 3 years ago #

  3. dillouz
    Member
    Posted 3 years ago #

    Thanks for your help.

    However,

    This works for posts, not for showing a photo on author.php

    at least it doesn't work for me

  4. @mercime
    Member
    Posted 3 years ago #

    author.php

    <?php
    $authordata = get_userdata();
    userphoto_the_author_photo();
    ?>

  5. dillouz
    Member
    Posted 3 years ago #

    Thank you, I think we're getting somewhere

    Now I get this instead of the image :

    Warning: Missing argument 1 for get_userdata(), called in /home/.tooter/wp-content/themes/polaroidtheme/author.php on line 17 and defined in tzipiyah.com/wp-includes/pluggable.php on line 121

  6. @mercime
    Member
    Posted 3 years ago #

    Whew, have to review the stuff, ok let's try another way. Just before the loop, add this

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

    then your name
    then inside the loop
    <?php echo userphoto_the_author_photo(); ?>

  7. dillouz
    Member
    Posted 3 years ago #

    Thanks but...
    Again :-/, I hope I'm not becoming annoying.

    I want to display the picture outside of the loop, in a profile I create for each user on author.php . When I use your code in author.php (not the posts but the profile section), nothing shows up...

  8. lambic
    Member
    Posted 3 years ago #

    I use this plugin:

    http://geekgrl.net/2007/01/02/profile-pics-plugin-release/

    And have this in my author.php:

    <?php
    global $wp_query, $userdata;
    $memberdata = $wp_query->get_queried_object();
    get_currentuserinfo();

    if (!strstr(author_image_path($memberdata->ID,false), "default"))
    author_image_tag($memberdata->ID);
    ?>

  9. Otto
    Tech Ninja
    Posted 3 years ago #

    @dillouz: Try this:

    global $authordata;
    $authordata=get_userdata(get_query_var( 'author' ));
    userphoto_the_author_photo();
  10. dillouz
    Member
    Posted 3 years ago #

    Otto42
    It works, thanks so much!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags