-
AuthorPosts
-
June 8, 2020 at 5:25 pm #1220535
Hello, the breadcrumb cuts off after a certain number of characters. is it possible to make it so it doesn’t get cut off?
June 14, 2020 at 11:47 pm #1222529Hey bobfurgo,
Sorry for the late reply, in researching this it seems that the portfolio breadcrumbs title can be modified with this function in your functions.phpfunction max_title_length( $title ) { $max = 200; if( strlen( $title ) > $max ) { return substr( $title, 0, $max ). " …"; } else { return $title; } } add_filter( 'the_title', 'max_title_length');
So the WordPress title limit seems to be 60 characters, with this function I can show 72 characters but not more, if you change the max to “2” the breadcrumbs will only show 2 characters.
So there seems to be another limit on the title, but the documentation I can find keeps pointing to this function.Best regards,
MikeJuly 7, 2020 at 2:42 am #1228461Hi Mike,
So, how would you limit the character count, I tried the above but it didn’t change anything.
In my case I have a post with a long title, which is a child page – so the title runs over the breadcrumb trail.
It’d be super handy to be able to do this is the title… as opposed to this is the title in its full length if you see what i mean.
any suggestions for that sort of solution?
thanks,
JasonJuly 8, 2020 at 1:51 pm #1228864Hi,
@Jason this code does change the title length, for 20 characters and “…” try adding this code to the end of your functions.php file in Appearance > Editor:function max_title_length( $title ) { $max = 20; if( strlen( $title ) > $max ) { return substr( $title, 0, $max ). " …"; } else { return $title; } } add_filter( 'the_title', 'max_title_length');
If this is not working for you then try clearing your browser cache and any cache plugin, and any server cache and check.
Otherwise, I recommend opening a new thread so we can assist, and include your admin login in the Private Content area, but as this is not your thread your login info will not be private if posted here.Best regards,
MikeAugust 7, 2020 at 3:25 pm #1236016Hi Mike! This also doesn’t seem to change the breadcrumb length by much. Anything else we can do?
August 12, 2020 at 4:28 am #1236806Hi,
Sorry for the delay. Edit the themes\enfold\framework\php\class-breadcrumb.php and around line 544, try to remove the avia_backend_truncate function or this line.
if( ! is_search() ) { $trail['trail_end'] = avia_backend_truncate( $trail['trail_end'], $truncate, " ", $pad="...", false, '<strong><em><span>', true ); }
This limit was added to prevent the breadcrumb and the main title from overlapping with each other.
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.