Support

Account

Home Forums General Issues Category Page with ACF. How do I display the ACF? Reply To: Category Page with ACF. How do I display the ACF?

  • Hi. Just realised that the above code is incorrect as that doesn’t get the current category’s ID. This should work…

    
    <?php 
    $category = get_category( get_query_var( 'cat' ) );
    $cat_id = $category->cat_ID;
    if(get_field('cat_image', 'category_'. $cat_id .'')) { ?>
    <?php the_field('cat_image', 'category_'. $cat_id .''); ?>
    <?php endif; ?>