Max Judul Batas Produk WooCommerce
add_filter( 'the_title', 'shorten_woo_product_title', 10, 2 );
function shorten_woo_product_title( $title, $id ) {
if ( ! is_singular( array( 'product' ) ) && get_post_type( $id ) === 'product' && strlen( $title ) > 20 ) {
return substr( $title, 0, 20) . '…'; // change last number to the number of characters you want
} else {
return $title;
}
}
Hamza Najam