I have this code to display term metadata but for some reason, it’s not showing up / Data is blank Sorry for not making it clear the first time
UPDATED
if ( 'new_column2' == $column_name ) {
/*Begin*/
foreach((get_term_meta( $post->ID, 'crosssell' )) as $category) {
$cat_name = $category->name . '</br>';
$cat_id = $category->term_id . '</br>';
$crosssell = get_term_meta( $cat_id, 'crosssell', true );
}
/*End*/
$value = $crosssell;
}
return $value;
}
what am i doing wrong
2
Answers
This fixed the problem I had.
You’re assigning variables but not actually outputting anything.