Advanced Custom Fields not printing field for category

I’m trying to print a custom field for a category but with no success.

This is my code:

     $args = array(
    'taxonomy'  => 'gb_category',
    'orderby'   => 'name',                                      
    'style'     => 'list',
    'hide_empty' => 0,
 ); 

$categories = get_categories($args);
$i = 1;
foreach ($categories as $cat) {

    the_field('category_custom_field');

}

Related posts

Leave a Reply

1 comment

  1. Solved.

    If you need custom filed for category then you call with following code:

    <?php the_field('starting_from', 'category_'.$cat->cat_ID); ?>
    

    and if you have custom category type then you call with this code:

    <?php the_field('starting_from', 'category_type_'.$cat->cat_ID); ?>