WPIntell

Source evidence

Problems displaying ACF

Advanced Custom Fields (ACF®) · support · 2026-05-28T18:00:00+00:00

complaintsentiment
mediumseverity
0.92relevance
3replies
Evidence linked to opportunitycommercial context

Proof Health

Open evidence

Commercial opportunities need traceable source links before they are treated as build-worthy.

5 / 31 rows with source links

16.1% of this page's analysis has direct source links.

0 build-decision rows missing links

0 rows here require auditable proof before promotion.

26 rows with no attached evidence

0 rows have source counts but still need direct links.

Conversation

support
Michael Lindström unresolved
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: <?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 to see the link] 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. solved it partly (thank you @galbaras ) – now the style and h4 is diplayed but not the field Tried to change the acf_get_fields('group_690cc62871539') to get_field(‘group_690cc62871539’) Didn’t help But one step in the right direction This reply was modified 1 month, 1 week ago by Michael Lindström . This reply was modified 1 month, 1 week ago by Michael Lindström . As you can see in the documentation , 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 ).

Comments

3 shown
Gal Baras 2026-05-29T03:43:00+00:00

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.

Michael Lindström 2026-05-29T19:24:00+00:00

solved it partly (thank you @galbaras ) – now the style and h4 is diplayed but not the field Tried to change the acf_get_fields('group_690cc62871539') to get_field(‘group_690cc62871539’) Didn’t help But one step in the right direction This reply was modified 1 month, 1 week ago by Michael Lindström . This reply was modified 1 month, 1 week ago by Michael Lindström .

Gal Baras 2026-05-29T23:54:00+00:00

As you can see in the documentation , 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 ).