Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function content($limit) {
- global $post;
- $content = explode(' ', get_the_content(), $limit);
- if (count($content)>=$limit) {
- array_pop($content);
- $content = implode(" ",$content);
- $content = force_balance_tags($content);
- $content .= '...<a href="'. get_permalink($post->ID) . '">'.__('Read full post','language') .'</a>';
- } else {
- $content = implode(" ",$content);
- }
- $content = preg_replace('/\[.+\]/','', $content);
- $content = apply_filters('the_content', $content);
- $content = str_replace(']]>', ']]>', $content);
- return $content;
- }
- function contentnoimg($limit) {
- global $post;
- $content = explode(' ', get_the_content(), $limit);
- if (count($content)>=$limit) {
- array_pop($content);
- $content = implode(" ",$content).'...<a href="'. get_permalink($post->ID) . '">'.__('Read full post','language') .'</a>';
- } else {
- $content = implode(" ",$content);
- }
- $content = preg_replace('/(<img.+?>)/','', $content);
- $content = apply_filters('the_content', $content);
- $content = str_replace(']]>', ']]>', $content);
- return $content;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement