Created
July 21, 2012 20:54
-
-
Save gyrus/3157158 to your computer and use it in GitHub Desktop.
Output WordPress content without first paragraph
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Output WordPress content without first paragraph | |
* | |
* @uses get_the_content() | |
*/ | |
function pilau_the_content_without_first_paragraph() { | |
$content = trim( apply_filters( 'the_content', get_the_content() ) ); | |
$content = preg_replace( '#<[a-z]+>[^<]+</[a-z]+>#', '', $content, 1 ); | |
echo $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment