WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Pete
    Member
    Posted 1 month 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

    https://wordpress.org/plugins/taxonomy-meta/

Reply

You must log in to post.

About this Plugin

About this Topic