Guest User

Untitled

a guest
Aug 7th, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. function get_excerpt($lenght = 25, $show_shortcodes = '') {
  2.  
  3. if ($this->post->post_excerpt != '') {
  4. return $this->post->post_excerpt;
  5. }
  6.  
  7. if (empty($lenght)) {
  8. $lenght = 25;
  9. }
  10.  
  11. $buffy = '';
  12. //print_r($this->post);
  13.  
  14. //remove [caption .... [/caption] from $this->post->post_content
  15. $post_content = preg_replace("/\[caption(.*)\[\/caption\]/i", '', $this->post->post_content);
  16.  
  17. $buffy .= td_util::excerpt($post_content, $lenght, $show_shortcodes);
  18. return $buffy;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment