Use is_tax()
:
if ( is_tax( 'book_categories' ) ) {
}
if ( is_tax( 'book_year' ) ) {
}
Related Posts:
- How to enqueue scripts on custom post add/edit pages?
- Custom Post Type pages are “not found”
- Custom post type single page returns 404 error
- Hide content box with Custom Post Type?
- Change the text on the Publish button
- Remove taxonomy slug from a custom hierarchical taxonomy permalink
- Remove “posts” from admin but show a custom post
- How does WP custom post types fare compared to Drupal’s?
- Orderby custom field for custome post type
- How to show term-specific post list, without posts associated with child terms?
- List upcoming events, ordered by date in a custom field
- taxonomy list display custom post count
- Custom wp_query pagination – next_posts_link() or wp_pagenavi() always empty
- Pagination problems with multiple custom post type archive pages
- Categories or Custom Post Type to Organize Content
- Include different loop templates in search query
- WordPress Rewrite rule for nested post types
- Custom post type taxonomy template
- Re-order posts in query after
- Hiding Metabox from Screen Options Pull Down
- WordPress Rest API only returns content when posttype has editor capability
- No checkbox in wordpress posts list table for CPT
- Custom Post Type relationship with hierarchical parent and child permalinks
- Category page only displaying the posts from a custom type
- Custom post types, taxonomies, and permalinks
- Help Structuring Query for Archive Pages
- Custom Post Type vs. User Page
- How to rewrite custom post type with custom taxonomy urls?
- Hierarchical Custom Posts – Highlighting Current Post in Sub-Menu
- Display all custom post type posts and order them by an optional meta_key
- need advice on how to do a lists using custom post types – taxonomy vs postmeta
- Selecting New & Edit Page for Custom Post Types
- How to structure a site with product variations pages?
- check if post title in a custom post type exists in page
- Call custom post type by category
- Archive template not working for custom post type
- How to get updated data when save_post triggers?
- Displaying custom taxonomy in the admin list of a custom post type
- How to change custom post type permalink structure
- Second Set of Eyes: One custom taxonomy shows in Appearance > Menus, one does not
- Hiding posts by other users and non-logged in
- Several CPT’s with same Taxonomy name but with different Terms for each
- Order Custom Post Type by Custom Field Value
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- Get the taxonomy of a post hierarchically
- Query posts based on the meta key values of logged-in users?
- Hierarchical custom fields
- Specifying Mouseover Icon for Custom Post
- Sizing textarea field in custom metabox
- 4 column-loop ordered alphabetically with entries grouped (and labeled) by their first letter
- Is there something like has_no_term
- Custom Taxonomy Category link
- HowTo: Custom Post Type (Meta) to Custom Table
- How to have permalink like domain.com/term/postname?
- Fix permission error for deleting custom post from front-end?
- Archiving custom post content?
- How can I remove filters from custom post types?
- Custom post type slug 404
- Counts Posts ( custom post type ) by Author in author.php
- WordPress multisite – is it possible to have different taxonomies for each site?
- WP_Query order by two values
- copy images from custom field to another custom field
- Custom Query: If One Post Object Field Value Is The Same As Another
- How to use a specific custom field in a custom post type as slug
- Wp custom post custom capability not working together
- Group Custom post type in a taxonomy page by its child taxomony
- Display Taxonomy Term Children in a Drop Down without Submit Button
- Custom taxonomy query showing more than 4 posts
- Loading multiple post content in FancyBox
- Display CPT index page as front/home page
- How add column from new table in Custom Post Listing (admin)
- Home page is getting current-menu-item even if it’s not home
- jQuery UI & Admin (Calendar)
- no_rest_route in Unit Testing for REST endpoint for CPT registered via show_in_rest
- how to achieve this permalink abc.com/CPTName/CustomPostTypeCategorySlug/categoryname
- CPT loop doesn’t seem to account for post date?
- A certain theme is forcing it’s singular post layout
- have to do a while have post to show for two custom post types sharing the same taxonomy?
- How to change URL for custom post type archive?
- How to handle this wordpress custom post type rewrite problem?
- Metabox collapsed by default
- using search filter ajax for custom field type post
- Is it possible to arrange Custom Post Types from CPTUI into a Folder?
- relationship between custom post type?
- Attempting to get number of grandchildren of page in WP_Query loop
- How to use a custom post type as child of a particular post of another CPT?
- Automatically Add a default category to a Custom Post Type before save_post action
- Custom post Query and WordPress Post Query Clash
- Custom post types with child taxonomy not visible in admin
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Filter By Term Not Working – Custom Post Type
- Static front page has page url not site url
- Post is not being published after clicking on Publish button in Custom Post Type
- Custom Post Type with /%shop_name%/gallery/%gallery% permastruct?
- How to create content automatically when a post is published?
- Updating User Meta from Custom Post Field Upon Publish Not Working
- Pagination not working with custom loop
- Generate daily archive whenever any post type is added
- How to Create Short Code Using Custom Post type
- Looking for advice how to approach building a WordPress plug-in