Support

Account

Home Forums Feedback Add CSS class in archives pages using ACF in taxonomies

Solving

Add CSS class in archives pages using ACF in taxonomies

  • I want to add a CSS body class on every archive page of that has TRUE in an ACF implemented on each category. I added the ACF True/False to each category and I know how to use body_class filter. What I don’t get is how I can check the boolean value in the taxonomy to affect the archive page of that taxonomy.

  • 
    $queried_object = get_queried_object();
    $value = get_field('field_name', $queried_object);
    
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.