Hello,
I am new here, and also very new to php and wp. First of all, thanks for a wonderful plugin so I could add custom field to my posts.
I tried also to add an extra description field to my categories. The difficult side here for me is to display it in a category template.
My field name is “my_cat_desc”. And I tried to put in category.php template:
php the_field('my_cat_desc', get_query_var('cat'));
But nothing shows up ( I could put sth in the field on category admin page).
Could you please help me?
Please see: http://www.advancedcustomfields.com/resources/functions/the_field/
You need to construct the correct $id value to get your field, which is a combo of the taxonomy slug and the term id.
$id = 'category_'.get_queried_object()->term_id;
the_field('my_cat_desc', $id);