Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function mt_smart_excerpt(){
- $content = get_the_excerpt('');
- $dot = ".";
- $position = stripos ($content, $dot);
- if($position) {
- $offset = $position + 1;
- $position2 = stripos ($content, $dot, $offset);
- $one_word = substr($content, 0, $position);
- $two_words = substr($content, 0, $position2);
- echo $two_words . '.';
- }
- else {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement