1 2 3 4 5 |
$post_content = $post->post_content; // get the content $post_content = strip_tags($post_content); // remove HTML tags $post_content = preg_replace('/\[(.*)\]/', '', $post_content); // remove shortcodes $post_content = substr($post_content, 0, 30); echo $post_content; |