I believe you are talking about when the archive.php is used as a taxonomy page.
If so, you will first need to check if the current page being viewed is actually a taxonomy page. If you don’t do this check, you will get errors on pages that are not taxonomy pages, for instance date archive and category archive pages if they all make use of the archive.php template. The reason is, the queried object varies from page to page, the queried object is diffirent for a taxonomy page than for a date archive page
So you would wrap your queried object inside a is_tax()
conditional check to make sure that the taxonomy name only displays on the taxonomy page.
To get a complete overview of get_queried_object()
on a page/template, simply do the following
<?php
$queried_object = get_queried_object();
var_dump( $queried_object );
?>
Related Posts:
- How do I exclude a custom taxonomy from the post loop
- Display category posts grouped by taxonomy
- display posts with same taxonomy term
- Including all terms in wordpress tax_query
- Display one post from each term in a custom taxonomy [closed]
- Is it possible to sort the post based on a custom field?
- Looping Through Custom Tax Terms and Displaying All Posts For Each
- Group posts that matches a term in a loop
- Custom taxonomy template loop
- How to handle “the_terms” inside loop
- Modify main loop in taxonomy archive page
- All posts are still shown when adding category argument to query
- Operations with custom fields values in a loop
- echo current taxonomy id for this loop?
- How do I Use Multiple Loops with WP_Query?
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- How can marge these loop code?
- How do I display a list of posts under all hierarchical children of the current taxonomy?
- Posts in loop displaying all taxonomies
- WordPress Tag or Custom Taxonomy Return All Posts if has that Word in Post Title
- where is the 4th taxonomy terms? taxonomy terms is disaapearing in the loop
- Display all posts that use a custom taxonomy
- If Custom Taxonomy
- How can I reduce amount of ifs and else ifs in this specific block of code?
- Returning One custom taxonomy term name
- Exclude taxonomy term from all loops, but having it on widget
- Using WP_Query and Query_post for the loop?
- Loop to display ONLY custom taxonomy parent information [closed]
- Loop through custom taxanomy in post and display custom fields from posts
- List terms of custom taxonomy if matches other taxonomy
- Only display latest custom taxonomy post
- how to get the post id in the option tag
- How to get the term description in a taxonomy term archive query?
- Chaining Taxonomy Queries
- Problem with sorting in custom child taxonomy archive page
- How to add a shortcode function that returns the taxonomy slug of the actual post within the loop
- Group posts in a category based on tags in custom taxonomy
- How to loop custom posts that have an exact match in taxonomy terms?
- Get post meta value outside of the loop
- ACF – Get unique values of array
- Remove Custom metabox from particular page template is used
- Custom taxonomy shows full articles
- Is it possible to sort the post based on a custom field?
- Output slugs to use as class names for every taxonomy a post is attached to
- Multi level archive
- List active taxonomy terms
- sort Posts by custom user filed
- Query pages by child term
- Query Number of Loaded Posts in Loop
- Trying to achieve row posts below category with multiple loops in custom tax
- Custom Taxonomy + JQuery Tabs
- WordPress show posts from children terms of a taxonomy term
- Loop custom post type by taxonomy (Category)
- Get custom taxonomy value of post and output posts in same taxonomy
- How do I create a term for every value of a post meta?
- How home my code doesn’t display any feature image? Looping through post from a taxonomy and not getting feature images back
- Loop posts without any taxonomy
- How to looping taxonomy terms?
- get_the_term_list without links in 3.1
- get_term_children for immediate children only (not grandchildren)
- Creating a non-removable taxonomy term
- Is it possible to use one slug for Multiple Taxonomies?
- How can I set a default listing order on the admin page for a custom taxonomy? (without plugins)
- get taxonomy terms for parent and child
- On Taxonomy Template page, want to add Post_Type
- Separator for multiple terms
- The next_posts_link() show me a aditional page in blank
- Help building array hierarchically with taxonomies (to get posts)
- Next and Previous links on a single taxonomy page only link to same term
- Why does WP rename similar “term name”-slugs in separate taxonomies?
- How to dynamically build a multiple taxonomy query loop within a post type’s single loop?
- Change permalink of post if it belongs to custom taxonomy
- How to determine the depth of a term in a custom taxonomy?
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Term count by user
- Google Map Shortcode for Custom Taxonomy/Post Types
- Querying two taxonomies
- Custom taxonomy query is empty. 0 = 1 in SQL
- How do you reorder the custom taxonomies on the right side of a custom post edit page?
- Post loop for all taxonomy terms
- What is the most efficient way of implementing a notification system? [closed]
- How to add images to taxonomy terms? [duplicate]
- Echo custom taxonomy slug
- Remove a href from this code
- Adding a second custom taxonomy to a custom post type (both shown in its table)?
- Get post terms from multiple custom taxonomies
- How to get attached image to taxonomy..?
- custom taxonomies label in hebrew
- Amend taxonomy to search in wordpress admin
- filter for thumbnail not working for custom taxonomy term
- Change link of taxonomy when get_the_term_list( is used?
- Invalid taxonomy with custom script
- Displaying posts from a custom category
- How to add meta fields to custom taxonomy add/edit page?
- Passing a variable to register_taxonomy()
- Broken paths on taxonomies after changing permalink to post name
- Where to put a migration script to switch post information?
- Get post terms with hierarchical relationships
- Error in Custom Taxonomy UI
- Add Custom Taxonomy Terms as CSS Classes for CPT Posts in an Elementor Loop Item Template