Last active
October 20, 2016 22:37
-
-
Save maugelves/3350e32465f25648be6f249f92429a25 to your computer and use it in GitHub Desktop.
Get all but the first paragraph from a WordPress post. Use inside the Loop.
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 | |
/** | |
* Get all but the first paragraph from a WordPress post. Use inside the Loop. | |
* | |
* @author Mauricio Gelves <yo@maugelves.com> | |
* @return string | |
*/ | |
function get_all_but_first_paragraph( ) { | |
global $post; | |
$str = wpautop( get_the_content() ); | |
$str = substr( $str, strpos( $str, '</p>' ) + 4 ); | |
return $str; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment