I am attempting to add a conditional function to my index.php that will return the description of a term in my custom taxonomy on the page for that term above the list of posts only if the description exists. I want it to be in a styled div (id="term-descr"). So I tried:
<code>
<div id="term-desc">
<?php echo term_description() ?>
</div>
</code>
It worked fine on terms I had the description for, but on all other pages I ended up with the styled outline of the div with nothing in it, which looks funny. I think the function returns a br or something when it returns no value. So I tried to come up with a conditional function to make this work, something like:
<code>
<?php if (term_description() != 0 ) echo {?>
<div id="term-desc">
<?php term_description(); ?>
</div>
<?php } ?>
which doesn't work. I'm wondering if there is an easier way to do this or if I'm missing something.