• 1. Added a Meta key, named ‘catsource’ by selecting ‘category’ as Meta taxonomy, it is showing in meta list.

    2. Added following code in category.php to display this meta key data in category page:

    <?php if (function_exists('get_terms_meta')) { ?>
        <?php $metaValue = get_terms_meta($category_id, $catsource); ?>
    <?php } ?>
    
    <?php echo $metaValue; ?>

    But not showing at front-end in category page. Any clue?

    https://wordpress.org/plugins/custom-taxonomy-category-and-term-fields/

Viewing 1 replies (of 1 total)
  • Plugin Author Bas Matthee

    (@basmatthee)

    Are you sure that $catsource exists and keeps the name of the meta_field?

    Try to change to this:

    <?php if (function_exists('get_terms_meta')) { ?>
        <?php $metaValue = get_terms_meta($category_id, 'catsource'); ?>
    <?php } ?>
    
    <?php echo $metaValue; ?>

Viewing 1 replies (of 1 total)
  • The topic ‘Data is not showing in category template’ is closed to new replies.