I have created fields for terms using ACF. I have also created category.php
using the below code:
<?php
// load all 'category' terms for the post
$terms = get_the_terms( get_the_ID(), 'category' );
// we will use the first term to load ACF data from
if ( !empty( $terms ) ) {
$term = array_pop($terms);
if ( have_rows( 'page_banner' ) ) :
// loop through the rows of data
while ( have_rows( 'page_banner' ) ) : the_row();
$custom_field = get_sub_field( 'small_title', $term );
echo $custom_field;
endwhile;
else :
endif;
}
?>
But I am not getting the results, Need your help. Thank you.