Display some text conditional on having/not having meta
-
I have this piece of code that displays some text conditional upon a term description. If the term doesn’t have a description then some alternate text is displayed
<?php $description = get_queried_object()->description; if ( ! empty( $description ) ) : ?> <?php echo $description; ?> <?php else: ?> no term description <?php endif; ?>
I’d like to be able to do the same with this plugin. This is the code use to display my custom term meta
<?php $meta = get_option('suburbs1'); if (empty($meta)) $meta = array(); if (!is_array($meta)) $meta = (array) $meta; $meta = isset($meta[get_queried_object_id()]) ? $meta[get_queried_object_id()] : array(); $value = $meta['postcode1']; echo $value; ?>
Thanks for your help
- The topic ‘Display some text conditional on having/not having meta’ is closed to new replies.