-
-
Save jvanja/678e130aed371a017de01704c8c7065c to your computer and use it in GitHub Desktop.
How to get_the_content() with formatting
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 | |
/** | |
* Instead of calling get_the_content(), call this function instead, and it'll all be good | |
*/ | |
function get_the_content_with_formatting() | |
{ | |
ob_start(); | |
the_content(); | |
$the_content = ob_get_contents(); | |
ob_end_clean(); | |
return $the_content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment