using add_filter to create a wrapper around woocommerce_after_shop_loop_item

219 Views Asked by At

I want to be able to add a wrapper around the content in woocommerce_after_shop_loop_item the only way I have been able to do it is like this;

add_filter( 'woocommerce_after_shop_loop_item', 'funky', 9);

function funky(){
    echo '<div class="btn_cont">';
}

add_filter( 'woocommerce_after_shop_loop_item', 'funky1', 11);

function funky1(){
    echo '</div>';
}

Isn't there a way I can just use one function to echo the wrapper and the content? I know I can do this inside the templates but thats not what I want. Thanks

0

There are 0 best solutions below