Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mitchellkrogza/46144d47944d4616dbef0923416b3f21 to your computer and use it in GitHub Desktop.
Save mitchellkrogza/46144d47944d4616dbef0923416b3f21 to your computer and use it in GitHub Desktop.
Flatsome Theme Change Shop & Category Loop Product Title from <p> to <h2>
/**
* Flatsome Theme
* Change Shop & Catalog Product Titles from <p> to <h2>
* Adjust to <h3> <h4> <h5> <h6> as you require.
*/
if ( ! function_exists( 'woocommerce_template_loop_product_title' ) ) {
function woocommerce_template_loop_product_title() {
echo '<h2 class="name product-title ' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '">';
woocommerce_template_loop_product_link_open();
echo get_the_title(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
woocommerce_template_loop_product_link_close();
echo '</h2>';
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment