You should be able to use what you have and just wrap it with:
<?php if ( is_year( ) ) { ?> **Your Code** <?php } ?>
And changing 'hide_empty' => false
to 'hide_empty' => 1
should prevent the cats with no posts from showing.
Related Posts:
- List all custom post type posts from a given category?
- Category page only displaying the posts from a custom type
- get taxonomies from terms
- get_terms by custom post type
- Get Posts by Custom Post Type ,Taxonomy, and Term
- How to change permalink structure for custom post type and it’s taxonomies?
- Get the first post term
- Creating “static” taxonomies to choose from, inside custom post type?
- How to limit the number of terms (terms acts like categories)
- How do I list custom taxonomy terms without the links?
- wp_insert_term doesn’t work with custom post type’s taxonomy
- How to list all categories and tags in a page?
- show tags of custom post type ONLY
- Count posts that have specific taxonomy term attached
- Retrieve single term slug
- How to sort list of custom posts to get view like a tree of posts under categories and their children’s categories?
- display multiple term post from taxonomy in a single page
- Glossary with Custom Post Type
- How can you make permalink work for custom post type and taxonomy?
- If on term-page -> get the current term?
- Adding a term name from a custom taxonomy assigned to a post link displayed by a wp_query loop based on another taxonomy
- Get list of terms of current taxonomy archive for another taxonomy
- Get all taxonomies for all post types
- get_terms won’t display product_cat or any other custom taxonomies when specified
- How to get category image custom post type taxonomy in wordpress?
- Show Post Count of a Category
- Custom Post Types and Categories?
- Have a Custom Post Type index page display taxonomy items instead of posts
- How to create new category for custom post type?
- Get Post Primary Category
- How to check the terms in single custom post type template
- Pagination is not working on single-{slug}.php but works fine on page-{slug}.php
- How to get the post type from a category id?
- How to show CPTs in term archive
- Display all posts in main category and 1 subcategory
- Custom Post Type Archive Page Filtering
- Show category ID on custom post type
- Allow user to set custom order to a list of custom taxonomies?
- Categories of custom taxonomy don’t show any posts
- How to display custom taxonomies with links in filter menu?
- Limit amount of posts made within a custom taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- How do I display the taxonomy for a custom post type in an array
- How to get custom posts sub category link
- Display latest x posts from all categories in Custom Post Type/Taxonomy
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- Output terms for custom post types
- Categories and tags for custom post types
- Get parent category id from child category page for custom taxonomy
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- Invalid Taxonomy
- The Difference Between Categories and Tags and Taxonomies and Terms
- Get category if used in a custom post type
- Get assigned post categories
- Categories won’t appear on custom post type
- Custom Taxonomy Terms in Menu lead to which page?
- Custom Post Type with modified permalink structure results in 404
- Custom Post Type Taxonomy Term Order by Title
- Retrieve Custom Taxonomies with Description and Slug
- Displaying taxonomies as category links within sidebar and creating pages for these
- Using get_terms() to list terms from one custom taxonomy AND from one specific built-in category
- How to automatically create a terms based on each post of a post type
- Get List of Terms based on a given term (different taxonomy)
- CPT : Next or Previous term link when has not adjacent post
- Order posts by taxonomy terms
- automatically select taxonomy based on post meta
- How to show related posts of category on post within custom posttype
- How to display custom taxonomy term specific post?
- Display Custom Post Type Based on Taxonomy With WP_Query()
- How to order taxonomy terms by most recent post?
- Create custom post type categories
- Cannot get to work tax_query array for terms
- Set a Default CPT taxonomy by taxonomy id
- how to create custom taxonomy drop downs for parents and child
- How to manage a dynamic multi-level page hierearchy system?
- Categories manage
- Pages of my taxonomy terms are showing all posts
- I can not call the categories of custom post type
- Reuse the “category” slug for a custom post type
- How to create groups like that in buddypress?
- Update Cateogory Taxonomy Count for Attachment Post Type
- Filter Term By Parent Term – Custom Post Type
- Displaying the Taxonomy and a Queried Term on a taxonomy.php page?
- WordPress add taxonomies/terms list as a menu in archive page
- Create an additional template page for every term taxonomy
- Best way to structure article and issue relationship for CPT
- Taxonomy Grid Archive Help?
- Custom Post Type used for FAQs Accordion
- Get a list of categories ids
- Custom post type URL returns 404 error page
- List a custom post type’s posts ordered by nested custom taxonomy
- Author template – separate custom post type by custom taxonomy term for $curauth
- Custom Post Type order Title ASC
- get_the_term_list() wanting to loop through the returned values
- Display associated taxonomy child name on single CPT page
- show only one category posts in admin
- Issue On Listing Woocommerce Parent Tag List
- Taxonomy Archive URL + Template