Answer the question
In order to leave comments, you need to log in
How to display a custom field in a widget?
Good day!
An arbitrary field "section_icon" (type "Image", Return format = Link to image) has been added to the headings. This field must be displayed in the widget.
The widget is finalized in the wp-includes/class-walker-category.php file.
I do this, but the link to the image is not displayed:
$meta_values = get_post_meta($category->term_id, 'section_icon', true);
Answer the question
In order to leave comments, you need to log in
Outcome:
$term = get_queried_object();
$section_icon = get_field('section_icon', $term);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question