Created
December 12, 2013 20:35
-
-
Save chrdesigner/7934971 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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