Taxonomy Meta
Display some text conditional on having/not having meta (1 post)

  1. perthmetro
    Posted 1 year ago #

    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


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Taxonomy Meta
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic