diff --git a/includes/model/ListingAuthor.php b/includes/model/ListingAuthor.php
index 8a44971114..aa4e9379c7 100644
--- a/includes/model/ListingAuthor.php
+++ b/includes/model/ListingAuthor.php
@@ -238,16 +238,18 @@ public function author_listings_query() {
}
public function avatar_html() {
- $html = '';
- $author_id = $this->id;
- $u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
-
- if ( !empty( $u_pro_pic ) ) {
+ $html = '';
+ $author_id = $this->id;
+ $u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
+ $author_data = get_userdata( $author_id );
+ $display_name = ! empty( $author_data->display_name ) ? $author_data->display_name : '';
+
+ if ( ! empty( $u_pro_pic ) ) {
$html = wp_get_attachment_image( $u_pro_pic );
}
- if ( !$html ) {
- $html = get_avatar( $author_id );
+ if ( ! $html ) {
+ $html = get_avatar( $author_id, 96, '', $display_name );
}
return $html;
diff --git a/includes/model/Listings.php b/includes/model/Listings.php
index d77e529ac9..a97ff490cf 100644
--- a/includes/model/Listings.php
+++ b/includes/model/Listings.php
@@ -396,12 +396,13 @@ public function set_loop_data() {
$author_id = get_the_author_meta( 'ID' );
$author_data = get_userdata( $author_id );
- $author_first_name = ! empty( $author_data ) ? $author_data->first_name : '';
- $author_last_name = ! empty( $author_data ) ? $author_data->last_name : '';
+ $author_first_name = ! empty( $author_data ) ? $author_data->first_name : '';
+ $author_last_name = ! empty( $author_data ) ? $author_data->last_name : '';
+ $author_display_name = ! empty( $author_data->display_name ) ? $author_data->display_name : '';
- $u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
- $u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
- $bdbh = get_post_meta( $id, '_bdbh', true );
+ $u_pro_pic = get_user_meta( $author_id, 'pro_pic', true );
+ $u_pro_pic = ! empty( $u_pro_pic ) ? wp_get_attachment_image_src( $u_pro_pic, 'thumbnail' ) : '';
+ $bdbh = get_post_meta( $id, '_bdbh', true );
$listing_type = $this->current_listing_type;
@@ -434,7 +435,7 @@ public function set_loop_data() {
'author_link' => ATBDP_Permalink::get_user_profile_page_link( $author_id, $directory_type ),
'author_link_class' => ! empty( $author_first_name && $author_last_name ) ? 'atbd_tooltip' : '',
'u_pro_pic' => $u_pro_pic,
- 'avatar_img' => get_avatar( $author_id, apply_filters( 'atbdp_avatar_size', 32 ) ),
+ 'avatar_img' => get_avatar( $author_id, apply_filters( 'atbdp_avatar_size', 32 ), '', $author_display_name ),
'review' => $this->get_review_data(),
);
}
@@ -1634,43 +1635,58 @@ function loop_get_the_thumbnail( $class = '' ) {
$listing_prv_img = get_post_meta($id, '_listing_prv_img', true);
$listing_img = get_post_meta($id, '_listing_img', true);
$thumbnail_img_id = array_filter( array_merge( (array) $listing_prv_img, (array) $listing_img ) );
+ $link_start = '';
+ $link_end = '';
if ( empty( $thumbnail_img_id ) ) {
$thumbnail_img_id = $default_image_src;
- $image_alt = esc_html( get_the_title( $id ) );
- return "";
+ $image_alt = esc_html( get_the_title( $id ) );
+ $image = "
";
+ if ( ! $this->disable_single_listing ) {
+ $image = $link_start . $image . $link_end;
+ }
+ return $image;
}
$image_count = count( $thumbnail_img_id );
if ( 1 === (int) $image_count ) {
- $image_src = atbdp_get_image_source( reset( $thumbnail_img_id ), $image_quality );
- $image_alt = get_post_meta( reset( $thumbnail_img_id ), '_wp_attachment_image_alt', true );
- $image_alt = ( ! empty( $image_alt ) ) ? esc_attr( $image_alt ) : esc_html( get_the_title( reset( $thumbnail_img_id ) ) );
-
- return "
";
-
+ $image_src = atbdp_get_image_source( reset( $thumbnail_img_id ), $image_quality );
+ $image_alt = get_post_meta( reset( $thumbnail_img_id ), '_wp_attachment_image_alt', true );
+ $image_alt = ( ! empty( $image_alt ) ) ? esc_attr( $image_alt ) : esc_html( get_the_title( reset( $thumbnail_img_id ) ) );
+ $image = "
";
+ if ( ! $this->disable_single_listing ) {
+ $image = $link_start . $image . $link_end;
+ }
+ return $image;
} else {
- ob_start();
- echo "