dicem2016-03-04 15:56:45
dicem, 2016-03-04 15:56:45

Advanced Custom Fields how to display the value of an additional field in a category?

Installed the Advanced Custom Fields plugin on WP.
Created a new field for creating/editing categories.
Anyway, what a task. I need to create a field when creating/editing a category. A field with another heading H1. If this field is empty, then the standard title is used, and if the new field is filled with data, then the category title = data of the new field.
I can't display the field values ​​in any way, I use the following function:

     the_field('h1_caption', $term); 

I really ask for help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
mr_dev1l, 2016-03-04

headings are used get_field
and here is the whole code:

<?php $cat_page_title = get_field('h1_caption', "category_".get_query_var('cat'));
      if (!empty($cat_page_title)) {
           echo $cat_page_title;
            } else 

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question