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

H2 woocommerce in the Home

Home / Forums / Kadence Theme / H2 woocommerce in the Home

This topic is: Resolved
[Resolved]
Posted in: Kadence Theme
July 7, 2022 at 3:30 am

Hello, I would like to change the H2 of the product titles to H3. Hello, I would like to change the H2 of the product titles to H3. this code works for me on shop page:

/**
* Initiate the product title switch.
*/
function init_custom_woocommerce_product_loop_tags() {
if ( class_exists( ‘Kadence\Theme’ ) ) {
$kadence_theme_class = Kadence\Theme::instance();
remove_action( ‘woocommerce_shop_loop_item_title’, array( $kadence_theme_class->components[‘woocommerce’], ‘archive_title_with_link’ ) );
add_action( ‘woocommerce_shop_loop_item_title’, ‘custom_kadence_archive_title’ );
}
}
add_action( ‘init’, ‘init_custom_woocommerce_product_loop_tags’ );

/**
* Show the product title in the product loop.
*/
function custom_kadence_archive_title() {
global $product;

$link = apply_filters( ‘woocommerce_loop_product_link’, get_the_permalink(), $product );
echo ‘<h3 class=”‘ . esc_attr( apply_filters( ‘woocommerce_product_loop_title_classes’, ‘woocommerce-loop-product__title’ ) ) . ‘”>‘ . get_the_title() . ‘</h3>’;
}

I would like that same code for all the products on the Home page:

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