• Resolved vaibhavbthl

    (@vaibhavbthl)


    Hi

    Is there any way to display the badge only on the first image of the product? Right now it shows the badge on all the images, I only want it to show on the first gallery image of the product..

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    Can you please give me the link to the page with this product? Also – please tell me the name of your current WordPress theme.

    Regards

    Thread Starter vaibhavbthl

    (@vaibhavbthl)

    Sure, link is – https://www.rudragems.com/product/1-mukhi-rudraksha-pendant/

    I am using the basic storefront theme.

    Plugin Author ILLID

    (@mihail-barinov)

    Please try to use following code snippet:

    add_filter( 'awl_labels_hooks', 'my_awl_labels_hooks' );
    function my_awl_labels_hooks( $hooks ) {
        $hooks['on_image']['single'] = array( 'woocommerce_product_thumbnails' => array( 'priority' => 10, 'js' =>  array( '.woocommerce-product-gallery__image', 'append' ) ) );
        return $hooks;
    }

    You need to add it somewhere outside the plugins folder. For example, inside functions.php file of your theme or use some plugin for adding code snippets.

    Regards

    Thread Starter vaibhavbthl

    (@vaibhavbthl)

    I added the code to my theme’s functions.php thru code snippers and it worked.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only display the badge on the 1st image’ is closed to new replies.