Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove title from woocommerce_single_product_summary hook?

On my product template, I execute this action :

<?php
    /**
     * woocommerce_single_product_summary hook.
    *
    * @hooked woocommerce_template_single_title - 5
    * @hooked woocommerce_template_single_rating - 10
    * @hooked woocommerce_template_single_price - 10
    * @hooked woocommerce_template_single_excerpt - 20
    * @hooked woocommerce_template_single_add_to_cart - 30
    * @hooked woocommerce_template_single_meta - 40
    * @hooked woocommerce_template_single_sharing - 50
    */
   do_action('woocommerce_single_product_summary');
?>

What I want is do remove the woocommerce_template_single_title hook so in my functions.php file I wrote this code :

remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 1);

But it does not work and I don't know how.

Thanks for your help

!! EDIT !!

Nevermind I solved it by writing this:

remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);

The priority have to match

like image 827
Corentin Branquet Avatar asked Mar 01 '17 09:03

Corentin Branquet


1 Answers

The author has added the one-liner to his question; as suggested by @Bugs, here it is as an answer.


// Remove title hook Woocommerce
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_title', 5);
like image 166
davewoodhall Avatar answered Oct 15 '22 22:10

davewoodhall