point is, my custom field is not WYSIWYG, but multiline textarea.
when i present it in the content template, without the excerpt shortcode, the breaks are there, e.g:
line one
line two
etc...
but when i use the excerpt shortcode, the breaks are gone, e.g:
line one line two etc...
this is the snippet:
function custom_trim_field( $atts, $content = null ) {
// Extract any arguments passed
extract( shortcode_atts( array(
'length' => 40, // Number of words to show
'more' => 'קראו עוד...', // Text to show at the end of the filtered text
'field' => '',
'postid' => '0'
), $atts ) );
global $post;
if ( empty($field) ){
return;
}
if ( !isset($post) ){
return;
}
$field = types_render_field($field, array("raw"=>"true"));
$excerpt_more_link = ' <a href="' . get_the_permalink($postid) . '">' . $more . '</a>';
$output = wp_trim_words( $field, $length, $excerpt_more_link ); // create the filter text
return $output; // return filter text
//example: [trimfield length="100" more="Read more..." field="wysiwyg" postid="[wpv-post-id]"][/trimfield]
}
add_shortcode( 'trimfield', 'custom_trim_field' );
Hello. Thank you for contacting the Toolset support.
Well - can you please share problem URL where you want to display excerpt and what is your excerpt field with which you have issues that it does not render line breaks.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).
I have set the next reply to private which means only you and I have access to it.