Hello,
With your help was successful in getting the subtitle loop into the cart. Thanks again!
My final task is to get subtitle to also appear under product name for
Search results.
I recently made some progress, but now stuck and need some help.
When the first result in the search is a product that has the subtitle, the subtitle also appears under every menu item in the header.
How do I prevent the subtitle from appearing in the menu header?
This is the code I’m using.
function kia_subtitle_for_woocommerce_products_title( $title, $product ){
if ( is_search() && get_post_type() === ‘product’ ) {
GLOBAL $product;
if( function_exists( ‘get_the_subtitle’ ) && $subtitle = get_the_subtitle( $product->id ) ){
$title .= ‘<div class=”searchauthor”>’ . $subtitle . ‘</div>’;
}
}
return $title;
}
add_filter( ‘the_title’, ‘kia_subtitle_for_woocommerce_products_title’, 10, 2 );
Hope you can help. Many thanks in advance!