The problem is that category_name is a reserved keyword for the built-in categories for posts. Almost anything category_* is reserved. You can find a list of reserved keywords at the following url:
https://codex.wordpress.org/Reserved_Terms
This includes, but is not limited to:
- cat
- category
- category__and
- category__in
- category__not_in
- category_name
- term
- terms
Behind the scenes it sees that you’re using the category_name reserved keyword. It knows categories are a taxonomy of posts and switches to the archive.php template. If the archive.php template did not exist it would default to index.php and try to load posts looking for anything in the test category (taxonomy).
Related Posts:
- What template is used for a custom taxonomy page?
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- Display all posts for taxonomy term across multiple custom post types
- Get list of taxonomies associated with Subscribers
- Custom Taxonomy isn’t working from frontend post submitting
- How to use multiple archive templates for a taxonomy?
- Can You Build Page Templates Without Extra Files
- Taxonomies specific to Page attribute template
- Taxonomies on Pages with Custom Formatting
- add pagination in wordpress page template
- Link a page from admin to a custom taxonomy
- Custom taxonomy page template name and how to use it?
- How to save custom taxonomy archive as a page template?
- Run next query based on first query’s term
- Custom taxonomy page uses index.php
- Custom taxonomy subcategories template page
- How can I get parent term from a child term
- Altering the appearance of custom taxonomy inputs
- Is ACF being a honey trap? [closed]
- How to get WooCommerce Product Category Link by ID?
- Adding An Image To A Custom Taxonomy Term
- How to display a listing template of a certain taxonomy?
- Post Formats in the context of the Database ‘Save Post’ function
- Rewrite rule for custom taxonomy
- Dropdown: Display terms from B only if has relationship with a term A selected
- How do you add custom taxonomy capabilities exactly?
- How to set hierarchical terms to a post using wp_set_object_terms
- Adding Custom taxonomies to Press This panel
- Taxonomy page lead to 404 page on pagination
- Excluding a custom taxonomy term breaks wp_get_post_terms
- Can I turn off write-in tags/taxonomies?
- If taxonomy exists then to show some code
- Using a different template per Custom Taxonomies for single term archive pages
- How to get Custom Taxonomy ID from the post ID
- How do I add customize_register action AFTER adding a custom taxonomy
- Getting yoast title for custom taxonomy
- How to count the number of terms in a taxonomy
- All posts are still shown when adding category argument to query
- Get direct children of custom taxonomy
- How to add autocomplete to custom taxonomy for CPT
- List subcategory on taxonomy term page
- Current category link filter
- Using wp_list_categories to show more than one custom taxonomy
- Show all posts without a custom taxonomy
- How do I taxonomy terms based on terms they are used alongside?
- How can I populate a select element with terms from a custom taxonomy and filter post results?
- How do I list the pages of a custom taxonomy?
- Why does a new taxonomy term get created when I assign an existing term to a post?
- Add Image Uploader In Admin Panel
- Tell the difference between a term and page when they have the same ID
- How do I create a permalink structure with 2 taxonomies
- Custom taxonomy not appearing in menu administration panel
- Does using custom taxonomy is more CPU efficient than using meta_data?
- how can i display taxonomy instead of category on my web page?
- Taxonomy Meta Box in User Profile?
- WP REST API – get custom taxonomies based on terms & filter
- How can I make front page to display custom taxonomy page?
- Why doesnt this query work? (Custom Taxonomy)
- Display Posts by Custom Taxonomy Chosen Terms
- How do I get term data associated with the current post, where the result is not wrapped in HTML?
- How to show post list based on taxonomy term?
- WordPress autocomplete search with taxonomies
- Display empty custom taxonomies differently than with one with posts
- remove term from custom taxonomy list
- Display taxonomy with a maximum number of letters
- query to use to link to taxonomy single page
- Taxonomy archive template not working
- Loop and add Specific Categories and Products Images
- Dropdown list of taxonomies won’t display selected
- Display Child Categories of Current Post ID
- Unknown column ‘wp_posts.ID’ in ‘field list
- Custom taxonomies registered via plugin stop existing after function finishes running
- Echo ACF taxonomy field within a foreach for another taxonomy
- Keeping session instance of random display results over pagination breaks
- Rewrite Search URL Permalink For CPT Custom Taxonomies
- How can I rewrite the URL of my custom taxonomy to include the year?
- Infinite Scroll appending Next Product Category Term pages
- Listing Cities A custom taxonmy by selection order
- Template taxonomy-{taxonomy}.php doesn’t show my posts
- Count tags for current post and save into custom meta field (and update it on post edit)
- Problem registering custom taxonomy
- Limit Tag Links in Post Content
- Passing taxonomy id of taxonomy clicked on one page to another page
- Custom Taxonomy Not Being Recognized by is_tax()
- How to truncate the description in the admin panel for a custom taxonomy
- Permalinks incorrectly inserting multiple categories
- customize taxonomy Page
- Why is it defaulting to “uncategorized” even after I select a custom taxonomy
- Get one custom taxonomy category
- Creating a page for custom taxonomy archive
- WordPress Taxonomy Menu
- Insert code on specific taxonomy archives
- Returning info from MYSQL table via custom taxonomy
- get_term_children specific no id
- custom texonomy category child category list with parent head
- is_tax not working for custom taxonomy
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)
- wp_add_object_terms cant recognize a post ID
- Foreach for get_the_terms for hierarchical taxonomy don’t repeat Top Level Terms if contains multiple Second Level Terms
- Issue with WordPress Automatically Assigning Terms to Multiple Posts