{"id":771,"date":"2026-10-20T09:03:45","date_gmt":"2026-10-20T08:03:45","guid":{"rendered":"https:\/\/userswp.io\/documentation\/article\/show-author-avatar-and-cover-on-listings\/"},"modified":"2026-10-20T09:03:45","modified_gmt":"2026-10-20T08:03:45","slug":"show-author-avatar-and-cover-on-listings","status":"publish","type":"gd_place","link":"https:\/\/userswp.io\/documentation\/article\/geodirectory-extension\/show-author-avatar-and-cover-on-listings\/","title":{"rendered":"How to show the listing author&#8217;s profile picture and cover image on GeoDirectory pages"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">UsersWP has blocks and shortcodes for a user&#8217;s profile picture (avatar) and cover image. Set their user to <code>post_author<\/code> and they show the images of whoever owns the listing being viewed. Add them to your GeoDirectory details page template, or to the archive item template to show them on listing cards.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Profile picture<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;uwp_user_avatar user_id=&quot;post_author&quot; size=&quot;80&quot; link=&quot;1&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><code>size<\/code> is the width in pixels (50 by default) and <code>link=&quot;1&quot;<\/code> links the image to the author&#8217;s profile. In the block editor this is the UWP > User Avatar block: type <code>post_author<\/code> in its User ID setting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Cover image<\/h2>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;uwp_user_cover user_id=&quot;post_author&quot; link=&quot;1&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is the UWP > User Cover Image block. Neither block shows the buttons for changing the image unless you turn on its Allow to change setting, and even then only the user can see them on their own images.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Both together<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The UWP > Profile Header block shows the cover, the avatar and the user&#8217;s name in one piece:<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-markup\">&#091;uwp_profile_header user_id=&quot;post_author&quot;&#093;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the listing owner views their own listing, the profile header shows them buttons to change the images. Use the two separate blocks above if you do not want that.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a ready-made author section with name, avatar and bio, see <a href=\"https:\/\/userswp.io\/documentation\/article\/explore-settings\/settings-overview-for-userswp-general-author-box\/\">Settings Overview for UsersWP > General > Author Box<\/a>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">In PHP<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a custom template you can read the image paths from UsersWP&#8217;s user meta. Uploaded images are stored relative to the uploads folder. An avatar can also be a full URL, for example from social login.<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">$author_id = get_post_field( &#039;post_author&#039;, get_the_ID() );\n$uploads   = wp_upload_dir();\n$avatar    = uwp_get_usermeta( $author_id, &#039;avatar_thumb&#039;, &#039;&#039; );\n$banner    = uwp_get_usermeta( $author_id, &#039;banner_thumb&#039;, &#039;&#039; );\n\nif ( $avatar &amp;&amp; 0 !== strpos( $avatar, &#039;http&#039; ) ) {\n\t$avatar = $uploads&#091;&#039;baseurl&#039;&#093; . $avatar;\n}\n\nif ( $banner ) {\n\techo &#039;&lt;img src=&quot;&#039; . esc_url( $uploads&#091;&#039;baseurl&#039;&#093; . $banner ) . &#039;&quot; alt=&quot;&quot;&gt;&#039;;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">These values are empty when the user has not uploaded an image. The blocks fall back to the default cover and the Gravatar for you, so use them where you can.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>UsersWP has blocks and shortcodes for a user&#8217;s profile picture (avatar) and cover image. Set their user to post_author and they show the images of whoever owns the listing being viewed. Add them to your GeoDirectory details page template, or to the archive item template to show them on listing cards. Profile picture size is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[],"article\/categories":[5,15],"class_list":["post-771","gd_place","type-gd_place","status-publish","hentry","gd_placecategory-extensions-features","gd_placecategory-geodirectory-extension"],"_links":{"self":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/771","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/comments?post=771"}],"version-history":[{"count":0,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/771\/revisions"}],"wp:attachment":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/media?parent=771"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/tags?post=771"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/categories?post=771"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}