I'm using an if/else control structure to add class attributes to tags. Could I use a switch control structure instead and if so, how? If not, is there a better way to do this than what I'm doing?
<div <?php if (is_page( 'project' )) { echo 'class="project"'; }
elseif (is_page('home')) {echo 'class="home"'; }
elseif (is_page('contact')) {echo 'class="contact"'; }
?>>
</div>