GetGenie
91AI powered SEO assistant & content writer with 40+ templates, chatbot, NLP keyword research, AEO, GEO, SEO...
Allows a user to associate a photo with their account and for this photo to be displayed in their posts and comments.
User Photo is a WordPress plugin that allows users to associate a profile photo with their account via the 'Your Profile' page. Admins can also add user profile photos through the 'Edit User' page. The plugin generates resized images and thumbnails based on specified dimensions, which can be displayed in posts or comments using specific template tags.
This plugin is suitable for WordPress sites where user identification through profile photos is desired, such as community forums or blogs that encourage user interaction.
Best for: This plugin is best for community-driven WordPress sites that want to enhance user profiles with photos.
What it does well
Where it falls short
User Photo provides a straightforward way to manage user profile photos, but its outdated status may raise concerns about ongoing support and compatibility with newer WordPress versions.
Weston Ruter's own description of User Photo, lightly tidied.
Allows a user to associate a profile photo with their account through their “Your Profile” page. Admins may
add a user profile photo by accessing the “Edit User” page. Uploaded images are resized to fit the dimensions specified
on the options page; a thumbnail image correspondingly is also generated.
User photos may be displayed within a post or a comment to
help identify the author. New template tags introduced are:
userphoto_the_author_photo()userphoto_the_author_thumbnail()userphoto_comment_author_photo()userphoto_comment_author_thumbnail()Important: all of these “template tags” must appear inside of PHP script blocks (see examples below).
The first two should be placed in the posts loop near the_author(), and the second two in the comments
loop near comment_author() (or their respective equivalents). Furthermore, userphoto_the_author_photo()
and userphoto_the_author_thumbnail() may be called anywhere (i.e. sidebar) if $authordata is set.
The output of these template tags may be modified by passing four parameters: $before, $after, $attributes, and $default_src,
as in: userphoto_the_author_photo($before, $after, $attributes, $default_src).
If the user photo exists (or $default_src is supplied), then the text provided in the $before and $after parameters is respectively
prefixed and suffixed to the generated img tag (a common pattern in WordPress). If attributes are provided in the $attributes
parameter, then they are returned as attributes of the generated img element. For example: userphoto_the_author_photo('', '', array(style => 'border:0'))
Just added in 0.8.1 release are these two new template tags:
userphoto($user, $before = '', $after = '', $attributes = array(), $default_src = '')userphoto_thumbnail($user, $before = '', $after = '', $attributes = array(), $default_src = '')By using these, it is uneccessary to set the global $authordata to display a photo. Just pass $authordata, $curauth or
whatever variable you have which contains the user object, or (as of version 0.9), pass in a user ID or a user login name.
Here’s an example that shows a few ways of inserting a user’s photo into the post loop:
//this will display the user’s avatar if they don’t have a user photo,
<?php while (have_posts()) : the_post(); ?>
<div class="post" id="post-<?php the_ID(); ?>">
<h2><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<div class="meta">
<?php the_time('F jS, Y') ?>
by <?php the_author() ?>
<!-- displays the user's photo and then thumbnail -->
<?php userphoto_the_author_photo() ?>
<?php userphoto_the_author_thumbnail() ?>
<!-- the following two do the same since $authordata populated -->
<?php userphoto($authordata) ?>
<?php userphoto_thumbnail($authordata) ?>
<!-- and this is how to customize the output -->
<?php userphoto_the_author_photo(
'<b>Photo of me: ',
'</b>',
array('class' => 'photo'),
get_template_directory_uri() . '/nophoto.jpg'
) ?>
</div>
<?php the_content('Read the rest of this entry »'); ?>
</div>
<?php endwhile; ?>
If you want to display the user’s photo in the sidebar, just get the user ID or object and pass it into userphoto() or userphoto_thumbnail() like this:
<?php userphoto($posts[0]->post_author); ?>
If you want to display a user’s photo their author page, you may do this:
<?php userphoto($wp_query->get_queried_object()) ?>
In version 0.9 the boolean function userphoto_exists($user) has been introduced which returns true if the user has a photo and false if they do not.
Argument $user may be user object, ID, or login name. This function can be used along with avatars:
<?php
if(userphoto_exists($user))
userphoto($user);
else
echo get_avatar($user->ID, 96);
?>
Or if the new “Serve Avatar as Fallback” option is turned on, then the avatar will be served by any of the regular calls to display the user photo:
<?php
//this will display the user's avatar if they don't have a user photo,
// and if "Serve Avatar as Fallback" is turned on
userphoto($user);
?>
Other plugins for bookstores and publishers.
AI powered SEO assistant & content writer with 40+ templates, chatbot, NLP keyword research, AEO, GEO, SEO...
List the most recent posts with post titles, thumbnails, excerpts, authors, categories, dates and more!
Very customizable plugin to list posts by category (or tag, author and more) in a post, page or widget. Uses t...
A Customizable Testimonial plugin to Automate Collecting, Filtering, and Publishing Customer Reviews. Testimon...
PublishPress Authors is the best plugin for adding authors, co-authors, multiple authors and guest authors to...
Import your demo content, widgets and theme settings with one click. Theme authors! Enable simple theme demo i...