the_content()
function parsed the text from the db in such a way that paragraphs for example will get <p>
tag around them. However, when you retrieve the content outside of the loop you cannot use the_content()
. I'm currently using $db_object->post_content
. However, doing it this way, the text is not being parsed like with the_content()
, so by adding <p>
. Is just gives the plain text.
Is there a function in PHP, or does anyone know a equivalant function that parses the text the same way the_content()
does and output the correct tags around the text.
Thnx in advance.
Yes. Use
$content = $db_object->post_content;
$content = apply_filters( 'the_content', $content );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With