Hello, I would like to ensure that each user’s profile picture is automatically used as the default image for any ads they create. This should happen for every ad they make.
How can I achieve this? Is there perhaps a snippet or setting I can use?
Unfortunately, there is no simple snippet for this, it will require a custom implementation. If you are familiar with coding or have a developer, we can provide general guidance.
Please send more details regarding this, do you mean just showing the user image and hiding the Images field in the listing form, or the image gallery should still be available on the single listing page, but the listing category and search pages should show user images in the listing cards?
We have some themes which use this design, e.g. ExpertHive shows user images instead of listing ones Services – ExpertHive This is implemented by overriding the listing template parts, you can consider using one of such themes (MeetingHive also uses this design) or overriding template parts via a child theme to customize the listing image template part.
Hi, yes, something like that. I need to display the user’s profile picture instead of the one specifically inserted for the listing(in fact, it won’t be possible for customers to upload photos in the listings). This should apply wherever the listings are visible, like in the cards, etc.
Except on one page, which is the one you see when viewing all the listings from a single profile. In that case, I would like to remove the ad’s picture entirely.
You need to overwrite the template part /listing/view/block/listing-image.php, this is where the listing images are specified How to override template parts - HivePress Help Center. That is, you need to show the user image instead of the listing image (you can get it in $vendor=$listing->get_vendor()), or if a vendor is available, then immediately $vendor->get_image__url('thumbnail') (instead of thumbnail, there may be a different image size). After that, you need to add an exception that this is not a vendor page, this can be done using the is_singular('hp_vendor') check.