Custom avatar

This topic contains 4 replies, has 4 voices, and was last updated by  Patrik 5 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #478432

    John Marston
    Full Member
    Post count: 170

    in vw I used this snippet, but it doesn’t work in v2, what is the new code?

    add_filter(‘sd_detail_entry_author’, ‘sd_detail_entry_author_custom’);
    function sd_detail_entry_author_custom() {
    global $post, $preview;
    if (!$preview) {
    $author_id = $post->post_author;
    $post_type = $post->post_type;
    $entry_author = get_avatar(get_the_author_meta(’email’, $author_id), 100);
    } else {
    $user_id = get_current_user_id();
    $post_type = $post->listing_type;
    $entry_author = get_avatar(get_the_author_meta(’email’, $user_id), 100);
    }

    $post_id = $post->ID;

    // WPML
    $duplicate_of = geodir_is_wpml() ? get_post_meta((int)$post_id, ‘_icl_lang_duplicate_of’, true) : NULL;

    if (!$preview && function_exists(‘geodir_load_translation_geodirclaim’)) {
    $geodir_post_type = get_option(‘geodir_post_types_claim_listing’, array());

    if (in_array($post_type, $geodir_post_type)) {
    $is_owned = !$duplicate_of ? (int)geodir_get_post_meta($post_id, ‘claimed’, true) : (int)geodir_get_post_meta($duplicate_of, ‘claimed’, true);

    if (!$is_owned) {
    $entry_author = ‘‘;
    }
    }
    }

    return $entry_author;
    }

    #478455

    Kor
    Moderator
    Post count: 16516

    Hi John Marston,

    Thanks for your post. Have you tried using this plugin https://userswp.io/ to achieve what you needed there?

    #478682

    Paolo
    Site Admin
    Post count: 31211

    Hi John,

    who provided that code and what does it do exactly?

    Just FYI, we don’t really provide support for custom snippets as part of support.

    Thanks

    #483203

    John Marston
    Full Member
    Post count: 170

    You guys gave me that snippet a while back for V1 and its supposed to change the default gravatar image (the silhouette of a guys head) to my wheel image. If there is another way to edit that I’d like to know. I think I saw a default header image, default gravatar setting somewhere, in wpuser no? I’m running this snippet on boatpnw.com, but actually don’t think it works because a user just posted a location and since they haven’t set up gravatar.com, the guys head is loading by default.

    #483365

    Patrik
    Moderator
    Post count: 1971

    Hi,

    We would like to look into your site and then provide the proper solution for your issue. Can you please provide admin details and FTP details in private reply so that we can troubleshoot the issue?

    Regards,
    Patrik

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount