Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function string_limit_words($string, $word_limit)
- {
- $words = explode(' ', $string, ($word_limit + 1));
- if(count($words) > $word_limit)
- array_pop($words);
- return implode(' ', $words);
- }
- <?php if ( $woo_options['woo_post_content_home'] == "true" ) the_content(); else $excerpt = get_the_excerpt(); echo string_limit_words($excerpt,38); ?>
- function string_limit_words($string, $word_limit)
- {
- $words = explode(' ', $string, ($word_limit + 1));
- if(count($words) > $word_limit)
- array_pop($words);
- return implode(' ', $words) . '...';
- }
- function string_limit_words($string, $word_limit)
- {
- $words = explode(' ', $string, ($word_limit + 1));
- if(count($words) > $word_limit)
- {
- array_pop($words);
- $words[] = '[...]';
- }
- return implode(' ', $words);
- }
- echo string_limit_words($excerpt,38) . " ...";
- function string_limit_words($string, $word_limit)
- {
- $ellipses = '';
- $words = explode(' ', $string, ($word_limit + 1));
- if(count($words) > $word_limit) {
- array_pop($words);
- $ellipses = ' ...';
- }
- $newString = implode(' ', $words) + $ellipses;
- return $newString
- }
Add Comment
Please, Sign In to add comment