Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // shorten product title
- // code goes in functions.php for your child theme
- add_filter('the_title', 'modify_title', 10);
- function modify_title( $title ) {
- if ( is_woocommerce() || is_product_category() ) {
- if ( strlen( $title ) > 10 ) {
- $title = substr($title, 0, 10).'...';
- }
- }
- return $title;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement