Support » Fixing WordPress » Use tags elsewhere?

  • This may be a dumb question, but is it possible to call the userphoto_the_author_photo() template tag in places other than the post or comment loops? I’m trying to put the user photo in the left bar of a page template.

    Thanks…and thanks for a bl00dy useful plugin!


Viewing 12 replies - 1 through 12 (of 12 total)
  • As long as $authordata is globally set, you can call userphoto_the_author_photo() anywhere.

    Nice plugin…I tried using the tags in the sidebar and it works for only one author. Is there a tag available to call userphoto_the_author_photo() anywhere for users/subscribers as well as authors–I would like the pic of the person signed in to be displayed in the sidebar.

    Also is there a way to move the “photo field” to the top of the “Your Profile” Section

    I’m also trying to achieve this. Am i right in thinking $authordata is globally set by default/activation of the plugin?

    by using <?php userphoto_the_author_photo(); ?> I can see the user photo, however, the same userphoto exists for all my users.

    I wish to achieve the same as HNYC and display the photo relative to the signed in user.

    Am also looking to do exactly the same thing!

    It seems to draw the required info. from global $authordata but don’t know how to reset this for each user to display the relevant photo for each user.


    This is a very brutal solution:

    $user = get_userdata($user);
    		$authordata = get_userdata($user_id);
    		echo '<img src="' . get_option('siteurl') . '/wp-content/uploads/userphoto/' . $user->user_login . '.thumbnail.jpg" />';

    Can’t really recommend it… but it works!

    Can’t get that to work Abelito 🙁

    “As long as $authordata is globally set, you can call userphoto_the_author_photo() anywhere.”

    Hi, are you able to point me to some docs about setting $authordata globally?


    I got it to work by using 2 loops:

    heres my code for the first loop:
    (rewind_posts ends the first loop, or something to that effect :))

    <?php the_post(); ?>

    <?php global $authordata; echo userphoto_the_author_photo(); ?>

    <?php rewind_posts(); ?>

    I have got the same problem. I tryed all your solutions but they didn’t work. I am using the code which is

    <?php userphoto_the_author_photo(); ?>

    And I can see my picture however everyone see only my picture in the sidebar. How can I set my $authordata as global. Or is this problem arise from $autodata or any other thing?


    This should so it:

    global $post;

    The internals of the userphoto_* functions do global $authordata anyway, so doing an explicit statement to global $authordata shouldn’t be necessary.

    I have tried every solution (That I could find) and nothing will work for me!

    I’m trying to put the current logged in user’s avatar in the sidebar, but it only seems to produce the same avatar (mine, the admin). Has anyone got this working? and if so could you post the code you used?

    tection99 is a genius ! his solution

    <?php the_post(); ?>
    <?php global $authordata; echo userphoto_the_author_photo(); ?>
    <?php rewind_posts(); ?>

    works fine outside the loop.

    251 🙂 t/c all

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Use tags elsewhere?’ is closed to new replies.