add a sold class to post-block-out, optimize code
I want to add a class 'sold' to post-block-out.
I have reused some code from an "ad a sold tag to add" tutorial, and it works - but it looks wrong
PHP Code:
<?php if (get_post_meta($post->ID, 'cp_ad_sold', true) == 'yes') : ?> sold<?php endif; ?>
isn't there a better way, like check if cp_ad_sold = true, then echo 'sold'? or is the above snippet the way to go?
/phpnewbie