Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function content($num) {
- $theContent = get_the_content();
- $output = preg_replace('/<img[^>]+./','', $theContent);
- $output = preg_replace( '/<blockquote>.*<\/blockquote>/', '', $output );
- $output = preg_replace( '|\[(.+?)\](.+?\[/\\1\])?|s', '', $output );
- $limit = $num+1;
- $content = explode(' ', $output, $limit);
- array_pop($content);
- $content = implode(" ",$content)."...";
- echo $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement