Forums
Home / Plugin: LSD Custom taxonomy and category meta / Data is not showing in category template
(@ashish-verma)
9 years, 5 months ago
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/
(@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; ?>