Title: Problems displaying ACF
Last modified: May 28, 2026

---

# Problems displaying ACF

 *  [Michael Lindström](https://wordpress.org/support/users/mikeyswede/)
 * (@mikeyswede)
 * [1 week, 4 days ago](https://wordpress.org/support/topic/problems-displaying-acf/)
 * I’m just stupid or but I can’t display ACF
 * in my content-single.php (yes it is the right file I’ve already altered it a 
   few times…) I entered this code:
 *     ```wp-block-code
       <?php if(is_category('bokrecensioner')){    echo '<div style="padding: 15px; border: #000 dotted;">' . '<h4 style="text-align: center;">' . 'Bokfakta' . '</h4>'  . '<br>' .  '<p>' . acf_get_fields('group_69c7ce7cf28f7') . '</p>' . '</div>';}	elseif(is_category('biorecensioner')){    echo '<div style="padding: 15px; border: #000 dotted;">' . '<h4 style="text-align: center;">' . 'Filmfakta' . '</h4>'  . '<br>' .  '<p>' . acf_get_fields('group_690cc62871539') . '</p>' . '</div>';}	elseif(is_category('teater-och-showrecensioner')){    echo '<div style="padding: 15px; border: #000 dotted;">' . '<h4 style="text-align: center;">' . 'Showfakta' . '</h4>'  . '<br>' .  '<p>' . acf_get_fields('group_6a185df8e8409') . '</p>' . '</div>';}	elseif(is_category('streamingrecensioner')){    echo '<div style="padding: 15px; border: #000 dotted;">' . '<h4 style="text-align: center;">' . 'Streamingfakta' . '</h4>'  . '<br>' .  '<p>' . acf_get_fields('group_69d41ebee596d') . '</p>' . '</div>';}	elseif(is_category('dvdbd-recensioner')){    echo '<div style="padding: 15px; border: #000 dotted;">' . '<h4 style="text-align: center;">' . 'Videofakta' . '</h4>'  . '<br>' .  '<p>' . acf_get_fields('group_69c7dc06b14a7') . '</p>' . '</div>';}?>
       ```
   
 * but it doesn’t work
   I know I did something wrong but can’t figure it out…What
   I would like is to display different field group depending on which category 
   the specific post belongs to
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblems-displaying-acf%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/problems-displaying-acf/#post-18922426)
 * The function `is_category()` “Determines whether the query is for an existing
   category archive page”, while `content-single.php` seems like a template for 
   single posts, so the code will have no effect.
 * Change `is_category()` to `in_category()`, which checks if the current post is
   within any of the given categories, and it should work.
 *  Thread Starter [Michael Lindström](https://wordpress.org/support/users/mikeyswede/)
 * (@mikeyswede)
 * [1 week, 3 days ago](https://wordpress.org/support/topic/problems-displaying-acf/#post-18923349)
 * solved it partly (thank you [@galbaras](https://wordpress.org/support/users/galbaras/))–
   now the style and h4 is diplayed but not the field
   Tried to change the
 *     ```wp-block-code
       acf_get_fields('group_690cc62871539')
       ```
   
 * to get_field(‘group_690cc62871539’)
   Didn’t helpBut one step in the right direction
    -  This reply was modified 1 week, 3 days ago by [Michael Lindström](https://wordpress.org/support/users/mikeyswede/).
    -  This reply was modified 1 week, 3 days ago by [Michael Lindström](https://wordpress.org/support/users/mikeyswede/).
 *  [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * (@galbaras)
 * [1 week, 2 days ago](https://wordpress.org/support/topic/problems-displaying-acf/#post-18923503)
 * As you can see in [the documentation](https://www.advancedcustomfields.com/resources/acf_get_fields/),`
   acf_get_fields()` returns an array of objects. You must then loop over that array
   and construct a string from it. The same is true for `get_fields()` (see [here](https://www.advancedcustomfields.com/resources/get_fields/)).

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fproblems-displaying-acf%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/advanced-custom-fields/assets/icon.svg?rev=3207824)
 * [Advanced Custom Fields (ACF®)](https://wordpress.org/plugins/advanced-custom-fields/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/advanced-custom-fields/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/advanced-custom-fields/)
 * [Active Topics](https://wordpress.org/support/plugin/advanced-custom-fields/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/advanced-custom-fields/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/advanced-custom-fields/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Gal Baras](https://wordpress.org/support/users/galbaras/)
 * Last activity: [1 week, 2 days ago](https://wordpress.org/support/topic/problems-displaying-acf/#post-18923503)
 * Status: not resolved