Skip to content

Instantly share code, notes, and snippets.

@inakicalvo
Created September 7, 2019 08:12
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 inakicalvo/96b48a5ed5eef4365a2d44446e1b7d77 to your computer and use it in GitHub Desktop.
Save inakicalvo/96b48a5ed5eef4365a2d44446e1b7d77 to your computer and use it in GitHub Desktop.
Add product subtitle in Woocommerce product archives
// Add product subtitle in archives
add_action( 'woocommerce_after_shop_loop_item_title', 'add_product_subtitle_in_archive', 40 );
function add_product_subtitle_in_archive() {
if (function_exists('the_field')){
if (get_field('subtitulo')){
echo '<span class="product-subtitle">', the_field('subtitulo'), '</span>';
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment