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
- How to determ a custom post type url?
- 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 can I list all the categories under a Custom Post Type (taxonomy)?
- 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?
- How to get a list of term names of the custom post type im currently on in single.php
- 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
- Custom post type taxonomy template
- get_categories for custom post type and filter by custom taxonomy (brand) and list child categories of a defined category
- 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?
- Custom post taxonomies as tax_query terms?
- 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
- Category archive in with conjunction with custom post type is empty
- get_category_link() for custom post type does not include custom slug rewrite?
- How to Display Posts From Category Within a Custom Taxonomy?
- Targeting categories in custom fields
- Invalid Taxonomy
- Need help deciding on a taxonomy
- Get Posts by Category, Tag , and CPT Taxonomy
- The Difference Between Categories and Tags and Taxonomies and Terms
- Get category if used in a custom post type
- Get assigned post categories
- Default Category Page not showing custom post type which has taxonomy category
- 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
- Get terms for a specfic post from multiple taxonomies in custom post type
- Custom Post Type Taxonomy Term Order by Title
- Retrieve Custom Taxonomies with Description and Slug
- Custom post type, taxonomy and admin bar
- 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
- Custom post type archive page filters
- 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
- Get all posts for custom taxonomy term
- Display associated taxonomy child name on single CPT page
- show only one category posts in admin
- Issue On Listing Woocommerce Parent Tag List
- Is it possible for post and custom post type to share a category base slug?
- Taxonomy Archive URL + Template
- Get a custom post type’s taxonomy type term names displayed as checkboxes and filter
- Category display using conditions
- Separate archive template to show posts and CPT by same category/taxonomy
- How to list custom taxonomy terms without the hyperlinks?
- Add taxonomy or category slug to custom post types URL