Viewing 3 replies - 1 through 3 (of 3 total)
  • Yup, it’s possible. You’ll need two custom functions which contain the wrapping markup. They should be hooked into woocommerce_before_shop_loop_item_title with the appropriate priorities. You can see here that the thumbnail is hooked in with a priority of 10. So try something like 5 for your opening tag and 15 for the closing tag.

    Cheers

    Thread Starter Dragos Cristache

    (@dragoscristache)

    Could you post a code example? Thanks!

    add_action( 'woocommerce_before_shop_loop_item_title', 'jk_image_wrapper_open', 5 );
    add_action( 'woocommerce_before_shop_loop_item_title', 'jk_image_wrapper_close', 15 );
    
    function jk_image_wrapper_open() {
    echo '<div class="img-wrap">';
    }
    
    function jk_image_wrapper_close() {
    echo '</div>';
    }

    Give that a try.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Image Wrapper for thumbnails’ is closed to new replies.