Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End [Solved] Expressing WP’s the_content as a function and checking isset Re: [Solved] Expressing WP’s the_content as a function and checking isset

#77598
Eamonn
Member

Ahh. Here’s the answer:

http://digwp.com/2009/07/putting-the_content-into-a-php-variable/

The final code looks like this:

the_content();
$content = ob_get_clean(); ?>

echo "

";
} else {
echo "

";
}
?>

This now lets me apply margins, padding, etc. to a container only if it will be actually filled with content. Otherwise, empty div! Thanks Chris!