Problem: I would like to display some non-Types termmeta fields in my Blocks term archive page.
Solution: This would require a custom shortcode solution:
function archive_term_meta_func($atts) {
$a = shortcode_atts( array(
'slug' => ''
), $atts );
$term_id = isset(get_queried_object()->term_id) ? get_queried_object()->term_id : null;
if( $term_id && $a['slug'] ) {
return get_term_meta( $term_id, $a['slug'], true);
}
return;
}
add_shortcode("archive-term-meta",
"archive_term_meta_func");
Then use it like this in an archive:
[archive-term-meta slug="some-slug"]