$taxonomy = 'coupon_store'; $term = get_queried_object(); //get my store. $store_obj = get_the_terms($post->ID, 'coupon_store'); if ($store_obj != '') { foreach ($store_obj as $element) { $store_id = $element->term_id; $store_name = $element->name; $store_description = $element->description; $store_count = $element->count; $store_url = get_term_link($element, 'coupon_store'); } } $store_url = get_metadata('coupon_store', $term->term_id, 'junkie_store_url', true); $store_aff_url = get_metadata('coupon_store', $term->term_id, 'junkie_store_aff_url', true); $store_image_preview = junkie_get_store_image_url($term->term_id, 'term_id', 100); ?> <header class="page-heading clearfix"> <div class="entry-thumb-wrapper"> <a href="<?php echo $store_aff_url ? $store_aff_url : $store_url; ?> " target="_blank"><img src="<?php echo $store_image_preview; ?> " class="store-thumbnail" alt="<?php the_title(); ?> " /></a>
function custom_columns($row_content, $column_name, $term_id) { global $taxonomy; switch ($column_name) { case 'junkie_store_image': return '<img class="store-thumb' . $term_id . '" src="' . junkie_get_store_image_url($term_id, 'term_id', 75) . '" width="75px" />'; break; case 'junkie_store_url': echo get_metadata('coupon_store', $term_id, 'junkie_store_url', true); break; case 'junkie_store_aff_url': echo get_metadata('coupon_store', $term_id, 'junkie_store_aff_url', true); break; case 'junkie_store_active': echo get_metadata('coupon_store', $term_id, 'junkie_store_active', true); break; default: echo "err"; break; } }