How are you?
My problem is the following on my front page I'm displaying some cards, for example name and description, this information is from my taxonomy called event because I created some fields with ACF and I would like to print them inside the card but I don't know how to do it .
Below I'm putting the code on how I'm printing the cards
<?php if(is_front_page()):
$terms = get_terms(
[
'taxonomy' => 'evento',
'hide_empty' => false,
]
);
if (!empty( $terms ) && is_array( $terms ) ):
foreach ( $terms as $term ): ?>
<div class="col-lg-3 mb-5">
<div class="card">
<img src="..." class="card-img-top" alt="...">
<div class="card-body">
<h5 class="card-title"><?php echo $term->name; ?></h5>
<ul>
<li class="card-text">Date:</li>
<li class="card-text">Horário: </li>
<li class="card-text"></li>
</ul>
<a href="<?php echo esc_url( get_term_link( $term ) ) ?>" class="btn btn-primary" title="<?php the_title_attribute( 'before=Saiba mais: "&after="' ); ?>">Saiba mais</a>
</div>
</div>
</div>
<?php endforeach;
endif;
?>
<?php else:?>
<p><?php _e('xxxxxx'); ?></p>
<?php endif;?>
I need to print the values
initial_date
and end_date
Does anyone have any idea how to do this?
get_field()
/the_field()
documentation will detail how to retrieve field data attached to terms.