Why an arbitrary field returns 0?

Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
Good day, tell me that not doing the right thing
On each column will be inserted a picture which relates to the theme of this column
He created an arbitrary field using the plugin Advanced Custom Fields to add images to the headings joxi.ru/a2XzJePTyNp3br
So put in the code
The problem is that the picture is inserted only when a category has no entries
As soon as add a category entry in the url, nothing is transferred
by | 55 views

2 Answers

0 like 0 dislike
The problem is that fields ACF category works a little differently
Here off. documentation https://www.advancedcustomfields.com/resources/add...

In short:
// Need to define a variable with the current category
$term = get_queried_object();

And your code will look like this:
<?php $term = get_queried_object(); ?>\r
0 like 0 dislike
try this

Related questions

0 like 0 dislike
1 answer
asked May 22, 2019 by TosterUserName
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
40,796 users