WordPress.org

Ready to get started?Download WordPress

Forums

Simple User Listing
[resolved] User Profile Image Link (4 posts)

  1. bffnb
    Member
    Posted 7 months ago #

    Hi!

    Is it possible to help me out. I will link the User image

    <?php echo get_avatar( $user->ID, 90 ); ?>

    to the same link as it is at the h2 heading

    <h2><a target="_blank" href="<?php echo get_author_posts_url($user->ID); ?>">.....

    So if somebody clicks on the image it also get directed to the same url as the h2 heading (User Name). My own coding experiments to put the code together fail :)

    Thank you

    http://wordpress.org/plugins/simple-user-listing/

  2. helgatheviking
    Member
    Plugin Author

    Posted 7 months ago #

    Just wrap the link around the image. In theory:

    <a target="_blank" href="<?php echo get_author_posts_url($user->ID); ?>">
    <?php echo get_avatar( $user->ID, 90 ); ?>
    </a>

    Note, that's not tested, my computer is borked at the moment, and I can't get into helping you customize your theme html, so that's the best I can do. Hope it points you in the right direction at least.

  3. bffnb
    Member
    Posted 7 months ago #

    Hi Helga!

    Thx for your help. Works fine ;)

    best

  4. helgatheviking
    Member
    Plugin Author

    Posted 7 months ago #

    Well good. Just to be clear this should be in your theme's version of the template as described on the main plugin page.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.