Wednesday, September 13, 2023
HomeCSSjquery - Eliminate added size of title from relevant items in woocommerce

jquery – Eliminate added size of title from relevant items in woocommerce


I am utilizing the listed below code that Instantly reduces WooCommerce item titles on the fixed web page major store, group, and also tag web pages I intend to do additionally that for relevant items. what conditional tag must i include for relevant item below

// Instantly reduces WooCommerce item titles on the fixed web page major store, group, and also tag web pages.
// to an established variety of personalities
feature short_woocommerce_product_titles_chars( $title, $id) {
if (( is_front_page()|| is_shop()|| is_product_tag()|| is_product_category()) && & & get_post_type( $id) === 'item') {
// Begins if the item title is longer than 60 personalities
if (strlen( $title) > > 60) {
// Reduces it to 60 personalities and also includes ellipsis at the end
return substr( $title, 0, 60 ). '...';.
}
}

return $title;.
}
add_filter( 'the_title', 'short_woocommerce_product_titles_chars', 10, 2 );.

RELATED ARTICLES

Most Popular

Recent Comments