In this article you learn that how you show first paragraph content on page or post
Please check the below code snippet –
$content = apply_filters( ‘the_content’, get_the_content() );
$text = substr( $content, 0, strpos( $content, ‘</p>’ ) + 4 );
$final_text = preg_replace(“/<img[^>]+\>/i”, “”, $text);
echo $final_text;
This entry was posted in Uncategorized on April 3, 2015 by Rndexperts.