Answer the question
In order to leave comments, you need to log in
How to display a category image on a WordPress site (Advanced Custom Fields)?
Good afternoon!
There is such a design:
As you can see, you need to display the categories in this way:
Answer the question
In order to leave comments, you need to log in
Adding fields to a taxonomy term
TL;DR: Add a group of fields to a taxonomy, output the same as a post field, only passing the taxonomy object, how to get it in the dock
<?php
$id_page = get_the_ID();
$args = array(
'post_type' => 'Выбор страницы или категории где остальные категории перечислены'
//Тут допаргументы вывода
);
$query = new WP_Query( $args );
while ($query->have_posts()) : $query->the_post(); ?>
сам контент
<?php
endwhile;
wp_reset_query();
?>
<?php $image = wp_get_attachment_image_src(get_post_field('Название поля'), 'full'); ?>
<img src="<?php echo $image[0]; ?>" alt="<?php echo get_the_title(get_post_field('Название поля')) ?>" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question