Hiding empty content in WordPress
February 21st, 2006 - 10:07am
Turns out that there is a lot of empty sidebar lists (<ul> elements) when there are no blog entries in a newly created WordPress blog. In creating my own theme (epic), I've tried to clean up those sections by checking to see if there are any posts. This turns out to be an easy task to accomplish.
The trick is to wrap the HTML in a PHP block that checks to see if any posts exist. This is done by the following PHP code:
Sidebar List
