Home Support Themes ExpertHive Show Listing Image instead of Vendor Image on Main Site

Show Listing Image instead of Vendor Image on Main Site

  • Author
    Posts
  • Jave

    Hello,

    bought the theme and everything works fine so far.

    But i got one question – When i add the newest listings block on the “home” page it always shows the vendor picture instead of the image specifally uploaded to this listing. How can i change this?

    ihor developer

    Hi,

    Yes, this is how it works by default https://experthive.hivepress.io/services/ There’s a vendor profile image on the listing search and category pages (ExpertHive design is more focused on vendors than listings). It’s possible to show the listing image instead, but it requires PHP & CSS code snippets, please let me know if this works for you and I’ll post the instructions.

    Jave

    yes this would be great if you can give me some instructions for this 🙂

    ihor developer

    Please try using this PHP snippet, you can add it with the Code Snippets plugin:

    add_filter(
    	'hivepress/v1/templates/listing_view_block',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listing_image' => [
    						'path' => 'listing/view/block/listing-image',
    					],
    				],
    			]
    		);
    	},
    	1000
    );

    Also this CSS snippet should make images square, you can add it in Appearance/Customize/Additional CSS section:

    .hp-listing--view-block .hp-listing__image img {border-radius:3px}

    Jave

    i tried using the snippet but unfortunately it doesn’t seem to work :/ nothing changed

    ihor developer

    Please make sure that you added it as a PHP snippet via this plugin https://wordpress.org/plugins/code-snippets/ It seems to be ok when I test it locally:

    add_filter(
    	'hivepress/v1/templates/listing_view_block',
    	function( $template ) {
    		return hivepress()->helper->merge_trees(
    			$template,
    			[
    				'blocks' => [
    					'listing_image' => [
    						'path' => 'listing/view/block/listing-image',
    					],
    				],
    			]
    		);
    	},
    	1000
    );
    Jave

    Did it like this but couldn’t make it work. Anyway i did it within the child theme so that’s fine 🙂

    Another question:

    In the Expert Hive Theme the listing images (thumbnails) will only show up on desktop. I’d like to be shown on mobile and tablet too.

    Is there a way to do this properly?

    Jave

    Ah and one more!

    So as the listing images are now showing as i wanted – I got two main categories e.g. “A” and “B” with multiple subcategories each.

    Now i want for categorie “A” and the subcategories of it the listing images to be shown as thumbnails and for categorie “B” the vendor images (like before).

    How can i make this happen?

    Thanks i really appreciate the support over here!

    ihor developer

    1. It’s possible with this CSS snippet, but it may require further customizations (e.g. adding margins, changing widths):

    .hp-listing--view-block .hp-listing__header {display:block!important}

    2. There’s no easy way to do this unfortunately, this would require a custom PHP snippet for checking the listing category and rendering different template parts, also a conditional CSS snippet (for rounding the image borders for vendor images, and leaving them as-is for listing images).

    Jave

    Snippet works thanks 🙂

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

You must be logged in to reply to this topic.