I'm asking regarding the ACF plugin (Advanced Custom Fields)
I'm working on creating a category group that will add custom fields to the category pages. These are the fields:
They seem to work in storing the data (I can see the data is saved with an example category)
According to the docs, I'm supposed to use get_field
in the template files to get the value of the custom field. I'm in the category.php template, and using get_field
returns FALSE (bool).
Here is my code:
$sub_heading = get_field("sub_heading");
That should get the text that's stored in the "sub_heading" custom field, but instead it just returns FALSE (bool).
I also tried
$sub_heading = get_field("sub_heading", $cat->term_id)
The category page is displaying the category properly, and giving me the title and the description, but nothing is being returned from get_field
.