Hi!
I have posts loop in taxonomy-models.php (iPhone Models).
One post has prices for every term (iPhone 7, iPhone 8, etc).
How to display in Term Archive only row equal to the Term Name and show fields (from, price, time)?
I try to put this code in taxonomy-models.php
, but nothing happens.
prices
– repeater field
model_term
– taxonomy field
price_term
, time_term
– text fields
<?php
if (have_rows('prices')) {
while (have_rows('prices')) {
the_row();
$queried_object = get_queried_object();
$term_id = $queried_object->name;
if (get_sub_field('model_term') == $term_id) {
the_sub_field('price_term');
the_sub_field('time_term');
}
}
}
?>