WordPress.org

Ready to get started?Download WordPress

Forums

WP User Avatar
[resolved] How to add url?! (9 posts)

  1. davidgabunia
    Member
    Posted 1 year ago #

    Hello,

    Is it possible to add specific url to avatar via your plugin?
    I mean a link between an avatar and any page/post for example.

    thx

    http://wordpress.org/extend/plugins/wp-user-avatar/

  2. Bangbay Siboliban
    Member
    Posted 1 year ago #

    If you're using the shortcode, you can add a custom link:
    [avatar link="http://customlink"]

    If you're using get_wp_user_avatar or get_avatar in your template, you'll have to wrap a link around it.

    <a href="http://customlink"><?php echo get_wp_user_avatar(); ?></a>

  3. davidgabunia
    Member
    Posted 1 year ago #

    I'm using get_avatar in my template, but what to do if I have more than 20 authors and each avatar should have it's own specific link?

    Here's avatar in the upper right corner
    http://functiongrapher.org/?p=897

  4. Bangbay Siboliban
    Member
    Posted 1 year ago #

    It really depends what you want the link to be. If you want to manually enter URLs, you can store it in the author's Website field (see: http://codex.wordpress.org/Function_Reference/the_author_meta)

    If you stored it there, you could use this:

    <a href="<?php the_author_meta('user_url', get_the_author_meta('ID')); ?>"><?php echo get_wp_user_avatar(get_the_author_meta('ID'), 100); ?></a>

  5. davidgabunia
    Member
    Posted 1 year ago #

    All avatar must be linked to authors portfolio page.
    For example for this avatar http://functiongrapher.org/?p=897
    correct link will be http://functiongrapher.org/?portfolio=marika-kochiashvili

    But I don't know how to do this :(

  6. davidgabunia
    Member
    Posted 1 year ago #

    I change "ID" with "display_name" but no result(

  7. davidgabunia
    Member
    Posted 1 year ago #

    I change "usr_url" with "nickname" but now link is wrong
    http://functiongrapher.org/Marika_Kochiashvili
    not
    http://functiongrapher.org/?portfolio=marika-kochiashvili

    :(

    Does it seems I need manually enter URLs for all author's?!
    But I don't know how to do this :(

  8. Bangbay Siboliban
    Member
    Posted 1 year ago #

    Where are you storing the variable 'marika-kochiashvili'? Is this the author's WP login? If so, you can use:

    <a href="http://functiongrapher.org/?portfolio=<?php the_author_meta('user_login', get_the_author_meta('ID')); ?>"><?php echo get_wp_user_avatar(get_the_author_meta('ID'), 100); ?></a>

  9. davidgabunia
    Member
    Posted 1 year ago #

    Thanks, it works!
    I just replace upper dush in user login with simple dush.

    So, if user login contains two words, for example name and surname, you must use simple dash! For example, user login must be: john-smith.

    This is the only way this solution works.
    And it's quite enough.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.