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
October 24, 2010 at 6:48 am
#77598
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 "
} 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!