Created
February 15, 2019 04:37
-
-
Save melvinstanly/4b3315429fe85391ab494c54fbab3833 to your computer and use it in GitHub Desktop.
Woocommerce Product titles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Change product title for products in shop page | |
remove_action( 'woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title', 10 ); | |
function change_product_title() { | |
$additional_text = ' More info'; | |
echo '<h2 class="woocommerce-loop-product__title">' . get_the_title() .$additional_text.'</h2>'; | |
} | |
add_action('woocommerce_shop_loop_item_title','change_product_title'); | |
// Change product title in single product page | |
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title', 5 ); | |
function woocommerce_template_single_title_custom(){ | |
$additional_text = ' More Info'; | |
the_title( '<h3 class="product_title entry-title">', $additional_text.'</h3>' ); | |
} | |
add_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_title_custom', 5); | |
// <?php the_title( $before, $after, $echo ); ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment