Answer the question
In order to leave comments, you need to log in
How to display a custom field on the taxonomy page through Pods?
I'm trying to render a custom services_tax taxonomy field created via the pods plugin.
But he just ignores my attempts.
I tried both through $pods->display
and through get_term_meta, but for some reason nothing is displayed. Posts never had this problem before.
Perhaps the problem is that I'm using this output not in a loop? But what then should I add a loop to make it work?
<div class="prices-item">
<?php
var_dump(get_query_var('services_tax'));
$term_id = get_query_var('services_tax'); // текущая рубрика, предположим мы зашли в рубрику 65
echo get_term_meta( $term_id, 'price1', false ); // выведет: Какой хороший день
?>
</div>
Answer the question
In order to leave comments, you need to log in
You can try a couple of these options:
<?php
$servicesTax = get_post_meta($post->ID, 'services_tax', true);
echo $servicesTax;
?>
<?php
$servicesTax = get_post_custom_values( 'services_tax' );
foreach ( $servicesTax as $key => $value ) {
echo $value;
}; ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
endwhile;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question