• Resolved alexzaragoza21

    (@alexzaragoza21)


    Hello Support Team,

    I use WP show post to display carousel listings from directorist plugin.

    I am trying my best to get the merchant avatar and profile url.

    I use this function provided to me.

    add_filter( ‘wpsp_author_output’, function() {
    return sprintf(
    ‘<span class=”wp-show-posts-byline wp-show-posts-meta”>
    <span class=”wp-show-posts-author vcard” itemtype=”https://schema.org/Person&#8221; itemscope=”itemscope” itemprop=”author”>

    %4$s <span class=”author-name” itemprop=”name”>%3$s</span>

    </span>
    </span>’,
    esc_url( get_author_posts_url( get_the_author_meta( ‘ID’ ) ) ),
    esc_attr( sprintf( __( ‘View all posts by %s’, ‘wp-show-posts’ ), get_the_author() ) ),
    esc_html( get_the_author() ),
    get_avatar( get_the_author_meta( ‘ID’ ) )
    );
    } );

    But this brings me to the default WordPress author profile and gives me the default WordPress avatar.

    I am not a developer but I am willing to follow. Is there an easy way to do this?

    Thank you so much in advance. Hope you can guide me.

Viewing 1 replies (of 1 total)
  • Plugin Support Rafiz Sejim

    (@rafizsejim)

    Hello @alexzaragoza21 ,

    We are sorry for the delayed response.

    We are using custom user avatar for our listings and you are calling the default WP Avatar. You may try adding and adjusting the following code in the loop.

    $image_id	= get_user_meta( get_the_author_meta( 'ID' ), 'pro_pic', true );
    		$image    	= $image_id ? wp_get_attachment_image_src( $image_id, 'thumbnail' ) : '';
    		$image_url 	= is_array( $image ) ? $image[0] : $image;
    		echo "<img src='$image_url' alt='Author'>";

    Best Regards,

Viewing 1 replies (of 1 total)
  • The topic ‘Display Merchant AVATAR and get merchant profile url’ is closed to new replies.