B
B
Boris Belov2016-04-22 16:58:48
WordPress
Boris Belov, 2016-04-22 16:58:48

How to display a list of categories with custom fields?

Hello. It is required to implement a similar thing
. I'm thinking of doing it like this:
1) Offices, Warehouses, Trading areas - these will be headings, there will be records in them. This means that in order to display the characteristics of the headings on the Commercial terms page, you need to give them arbitrary fields. OK. Made arbitrary fields in ACF.
2) Next, you need to somehow display on the page a LIST of headings (not records, but headings) with their arbitrary fields. And I don’t understand how, all I found on the Internet is the output of a list of headings
. How can I implement such a thing?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
WP Panda, 2016-04-22
@wppanda5

$terms = get_categories();
foreach ( $terms as $term ){
echo ' Название рубрики:  ' . $term->name;
echo 'Мета поля: ';
var_dump( get_term_meta( $term->term_id )  );
}

R
Ruslan, 2016-04-30
@rOOse

ACF has its own function the_filed/get_field that displays/returns data, look at their documentation, it takes a term object and a field name.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question