Change position icons featured

Hi, I’m doing some customization to change positions and I found this snippet but it’s not working. I tried replacing (listing-featured-badge) with (listing-verified-badge) and the snippet works, but if I replace it it doesn’t work anymore. Can you help me?

   add_filter(
      'hivepress/v1/templates/listing_view_block', function ($template) {
       return hivepress()->helper->merge_trees($template, [
            'blocks' => [
            'listing_content' => [
                   'blocks' => [
                   'listing-featured-badge' => [
						'type'   => 'part',
						'path'   => 'listing/view/listing-featured-badge',
						'_order' => 15,
               ]        
            ]
         ]
      ]
   ]);

}); 

Please clarify which theme is used on your website.

ListingHive

Please try this PHP code snippet

add_filter(
    'hivepress/v1/templates/listing_view_block', 
	function ($template) {
		return hivepress()->template->merge_blocks(
			$template,
			[
				'listing_content' => [
                   'blocks' => [
                   'listing_featured_badge_custom' => [
						'type'   => 'part',
						'path'   => 'listing/view/listing-featured-badge',
						'_order' => 15,
               ]        
            ]
         ]
			]
		);
	},
	1000
);

Also, please try to add this CSS code snippet

.hp-listing--view-block .hp-listing__content .hp-listing__featured-badge{
	position: unset;
}

Thanks but it still doesn’t look good, the icon seems truncated in half without the text. And the other badges must no longer be visible

Hi! Try this CSS:

.fa-star:before { content:"Featured";
    font-family: sans-serif;
    font-size: 18px; }

.hp-listing--view-block .hp-listing__featured-badge {
    width: auto;
    padding: 0.2rem; }

No, dont work

Open your site in other browser, or private tab. Maybe it cached…

I already tried

Hm. That CSS is working on my website, without php, so this not solving your position changing problem, but as you see it have not clipped box, and display the whole text.

Hi, if you want i can send temporary WP access to support@hivepress.io and you can check

Hi,

Please note that you have been provided with a sample PHP snippet, if you need to modify it to work differently, I recommend using the fetch_block function.

Thank you andrii but i’m not a developer, I’m a graphic designer who enjoys being a developer. I think I don’t know how to do it

Hi,

If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work https://fvrr.co/32e7LvY

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.