Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

remove_action not working for woocommerce changing product loop titles

Home / Forums / Kadence Theme / remove_action not working for woocommerce changing product loop titles

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme

Tagged: 

November 14, 2020 at 11:40 am

I’m trying to change the product loop titles h2 to h4, but the remove_action does not seem to work.
Now I have two titles for the products on the shop page, one h2 title and h4 title for each products.

I added the following code in kadence child functions.php
// Changing product loop titles from h2 to h4
remove_action( ‘woocommerce_shop_loop_item_title’, ‘woocommerce_template_loop_product_title’, 10 );
add_action( ‘woocommerce_shop_loop_item_title’, ‘ChangeProductsTitleHTag’, 10 );
function ChangeProductsTitleHTag() {
echo ‘<h4 class=”‘ . esc_attr( apply_filters( ‘woocommerce_product_loop_title_classes’, ‘woocommerce-loop-product__title’ ) ) . ‘”>’ . get_the_title() . ‘</h4>’;
}

  • The forum ‘Kadence Theme’ is closed to new topics and replies.