• Resolved maxguerra

    (@maxguerra)


    Hi,
    I’m trying to use {user_avatar_small} in nav menu, but I get full path before avatar displayed (i.e. href=http://www.example.com/user/(image))

    How can I get through of this?

    Thx a lot. Mx.`

    • This topic was modified 4 years, 7 months ago by maxguerra.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @maxguerra

    Does this issue occur when you use a default WP theme such as 2020 or 2021?

    Regards,

    Thread Starter maxguerra

    (@maxguerra)

    Hi Champ,
    thanks for your answer, actually site is in production and I can’t switch theme, I’m using Consultup theme.

    Any tips?

    thx a lot. Mx.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @maxguerra

    Could you please provide a screenshot of the issue that you’re seeing on your site? You can upload the screenshot via imgur.com and then share the image URL here so we can review it.

    Regards,

    Thread Starter maxguerra

    (@maxguerra)

    Here it is.

    Thx.

    View post on imgur.com

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @maxguerra

    Please try adding the following PHP code to your theme/child-theme’s functions.php file:

    add_filter("um_allowed_user_tags_patterns","um_110821_custom_user_nav_tags");
    function um_110821_custom_user_nav_tags( $tags ){
       $tags[ ] = "{avatar_small_url}";
    
       return $tags;
    }
    
    add_filter("um_profile_tag_hook__avatar_small_url","um_110821_small_avatar_url");
    function um_110821_small_avatar_url( $string ){
        return um_get_user_avatar_url('',40);
    }

    Once the above code is added, add the following to the Menu Item’s Navigation label:

    <img src="{avatar_small_url}" width="40" class="gravatar avatar avatar-190 um-avatar um-avatar-gravatar"/>

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @maxguerra

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘{user_avatar_small} display issue’ is closed to new replies.