How to get custom post type taxonomy archive page and taxonomy page title in WordPress

How-to-get-custom-post-type-taxonomy-archive-page-and-taxonomy-page-title.

This code used for the custom post type gets a title for the archive page and taxonomy page.

<?php
// get the currently queried taxonomy term, for use later in the template file
$term = get_queried_object();
?>

<header class="archive-header">
    <h1 class="archive-title">
        <?php echo $term->name; ?>
        <?php //post_type_archive_title(); ?>
    </h1>
</header><!-- .archive-header -->
Learn Tutorials Point
We Well organized and easy-to-understand Interactive tutorials With lots of examples of how to use Tutorials WordPress, PHP, Bootstrap, Bootstrap 4, HTML, CSS, AJAX, jQuery, Woocommerce, Post, Database, Javascript, Theme, Responsive, Templates.

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact us

Fill in the form below or give us a call and we'll contact you. We endeavour to answer all enquiries within 24 hours on business days.