Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
global $post;
$trim_length = 450; //desired length of text to display
$summary_excerpt = 'wpcf-breve-descricao';
$value = get_post_meta($post->ID, $summary_excerpt, true);
if ($value != '') {
if(strlen($value) <= $trim_length){
echo apply_filters('breve-descricao', $value);
} else {
echo apply_filters('breve-descricao', rtrim(substr($value,0,$trim_length)).'...');
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.