Monday, 26 August 2013

Is there something like has_no_term

Is there something like has_no_term

I have a custom post type named 'Projecten' with a taxonomy called
'fases_projecten', in there i have 'concept', 'inontwikkeling' and
'gerealiseerd'. In my template I'm using the following code for displaying
changes between the sevral fases/terms.
`<?php if( has_term( 'concept', 'fases_projecten' ) ) { ?><div
class="status sActiveConcept"><?php } ?>`
For each fase I have a diffrent openingdiv class, but maybe it will happen
that the users of the website forget to choose a fase, witch mess up the
site completely because the openingtag of the div is missing.
So I was wondering if there exsists something like has no term.
What I already tried is
<?php if( has_term( '', 'fases_projecten' ) ) { ?><div
class="status"><?php } ?>
Also when I make do it like this:
<?php if( has_term( 'concept', 'fases_projecten' ) ) { ?><div
class="status sActiveConcept"><?php } ?>
<?php elseif( has_term( 'inontwikkeling', 'fases_projecten' ) ) { ?><div
class="status sActiveDeveloping"><?php } ?>
<?php elseif( has_term( 'gerealiseerd', 'fases_projecten' ) ) { ?><div
class="status sActiveFinished"><?php } ?>
<?php else( has_term( '', 'fases_projecten' ) ) { ?><div
class="status"><?php } ?>
It will not work, I get a servererror.
I hope I explained clear enough, my english is not so good though

No comments:

Post a Comment