I cant seem to get hooks working with woocommerce. I’m trying to learn but this piece of code doesn’t seem to work and Im not sure why, any ideas ? Thanks.

    add_filter ( 'woocommerce_before_main_content', 'et_filter_link' );

    function et_filter_link ( $content ) {

       $content = '<div class="test-div">Th-th-th-th-th Thats all, folks!</div>';

    return $content;


Read more here: Woocommerce hook not outputting string


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: