This support ticket is created hace 5 años, 6 meses. There's a good chance that you are reading advice that it now obsolete.
This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.
Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.
Hoy no hay técnicos de soporte disponibles en el foro Juego de herramientas. Siéntase libre de enviar sus tiques y les daremos trámite tan pronto como estemos disponibles en línea. Gracias por su comprensión.
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.