Advertisement
Guest User

Untitled

a guest
Sep 29th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. function mt_smart_excerpt(){
  2. $content = get_the_excerpt('');
  3. $dot = ".";
  4. $position = stripos ($content, $dot);
  5. if($position) {
  6. $offset = $position + 1;
  7. $position2 = stripos ($content, $dot, $offset);
  8. $one_word = substr($content, 0, $position);
  9. $two_words = substr($content, 0, $position2);
  10. echo $two_words . '.';
  11. }
  12.  
  13. else {
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement