Hi @amedic
You need to add the below-mentioned function in your theme’s function.php file.
function first_paragraph() {
global $post, $posts;
$post_content = $post->post_content;
$post_content = apply_filters('the_content', $post_content);
$post_content = str_replace('</p>', '', $post_content);
$paras = explode('<p>', $post_content);
array_shift($paras);
return $paras[0];
}
You need to call this function echo first_paragraph()
wherever you want to display the first paragraph of the content.
Hope this helps.
Regards,
-
This reply was modified 4 years, 2 months ago by Anonymous User 18274256.