The problem is this. Created a Custom Post Type (name = film). And all posts are displayed, respectively, on the page www.site.ru/film. I also created custom taxonomies for these headings: year and director. So, how can I see the names of the headings (without links) and the label next to the goods in the file archive-film.php? Ie, for example, in my Director’s section there is “Boris Khlebnikov”, we need to bring out the name - Boris Khlebnikov and the Label that WP himself creates (boris-hlebnikov in my case). I searched in Google, but there is other information.
Post type creation code
function film_create_post_type() { register_post_type( 'film', array( 'labels' => array( 'name' => __( 'Фильмы' ), 'singular_name' => __( 'Фильм' ) ), 'supports' => array('title','editor','thumbnail'), 'public' => true, 'has_archive' => true, ) ); register_taxonomy( 'year', 'film', array( 'label' => __( 'Год ' ), 'rewrite' => array( 'slug' => 'works' ), 'hierarchical' => true, ) ); register_taxonomy( 'producer', 'film', array( 'label' => __( 'Режиссёр' ), 'rewrite' => array( 'slug' => 'works' ), 'hierarchical' => true, ) ); } Also code achive-film.php
<?php $args = array( 'post_type' => 'film', 'posts_per_page' => -1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class="nearest-slide "> <div class="nearest-slide__photo"> <a href="<?php echo the_permalink();?>"> <?php echo the_post_thumbnail()?> </a> </div> <div class="nearest-slide__title"> <a href="<?php echo the_permalink();?>"> <h3><?php the_title()?></h3> </a> </div> <div class="nearest-slide__line"></div> <div class="nearest-slide__paragraph"> <p><?php echo get_field("film_small")?></p> </div> <div class="nearest-slide__bottom"> <div class="nearest-slide__date"><?php echo get_the_date('dmY')?></div> <div class="nearest-slide__link"> <a href="<?php echo the_permalink();?>"> <svg class="longarrow" width="18" height="18"> <use xlink:href="#longarrow"></use> </svg> </a> </div> </div> </div> <?php endwhile;?>