Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #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?

    #1222529

    Hey 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.php

    function 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,
    Mike

    #1228461

    Hi 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,
    Jason

    #1228864

    Hi,
    @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,
    Mike

    #1236016

    Hi Mike! This also doesn’t seem to change the breadcrumb length by much. Anything else we can do?

    #1236806

    Hi,

    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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.