You can get the post type object and check its properties. For example:
$post_type = get_post_type_object( 'books' );
if( $post_type->exclude_from_search ) {
// The post type is not included in search results
}
if( $post_type->has_archive ) {
// The post type has archive
}
As far I know, custom post types are not included in dates archives nor author archives if you don’t code for it (using pre_get_posts
for example). I mean, those options are not available while registering a post type. So, there is no way to check it from post type object.
Related Posts:
- If on term-page -> get the current term?
- Custom Taxonomy Breadcrumb Navigation
- Get the posttype of a taxonomy/term
- Custom post type not displayed in breadcrumbs on archive page
- Parent Page and Breadcrumb URL’s for Custom Post Types Not Working
- Breadcrumb Not Linking to the Correct Custom Post Type Index Page(s)
- Using breadcrumb to return from single-page to list
- Custom Post Type and Breadcrumbs Conflict
- Problem retrieving informations and displaying desired structure with custom post type and taxonomy
- Multiple categories assigned to a single product breaking the breadcrumb
- Link custom post type to parent page and show in slug / breadcrumb
- Title and URL Error in Breadcrumb Navigation for Custom Post Types
- Post template with breadcrumb needs to show page navigated from
- Custom post type archive false is not compatible with breadcrumbs
- WooCommerce breadcrumb display custom posts instead of product data
- Breadcrumb that shows multiple custom taxonomies
- How to retrieve taxonomy terms of the current custom post?
- how do I create a breadcrumb to work with multiple custom taxonomies
- custom post type breadcrumb error when has_archive = false
- How to sort the admin area of a WordPress custom post type by a custom field
- Enable revisions for custom post type
- Add category base to url in custom post type/taxonomy
- Displaying Custom Post Types In “At A Glance” Meta Box
- How do I require authorization / login to view a specific set of posts / pages?
- WordPress Custom Post Types with a page as a parent?
- How to Make an admin_notices Message That Disappears Once the User Leaves That Particular Page?
- Page is defaulting to archive page and not designated template
- I can’t set meta_key in my custom post type query
- Removing parent slug from URL on custom post type
- Remove POST_TYPE from custom post type permalink
- Redirect a page based on last word in slug
- How to publish custom post type for custom role user and not “submit for review”?
- Custom post types and permalink
- Custom post types, taxonomies, and permalinks
- How do I fix permalinks for custom post types that has the same slug as a page?
- How to call custom posts
- How to get the parent of a non-hierarchical custom post type being edited in Gutenberg
- Why is my select meta data not saving?
- Add custom taxonomy to post content body?
- Create a custom post with custom post-metadata with WP API
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Time based access control of custom post types – what is good approach?
- Allow Contributor to edit but not update a published post
- Get custom post type’s fields in a while loop as variables
- Custom post types and category archive
- General advice on addressing content-centric pages
- Not Able To Render Single-CustomPostType.php File
- Mutiple Select only POSTing 1 value
- Get an array wich contains the post_name of every post that has the custom post_type “pelicula”
- get_post_type is always post
- Custom taxonomy (categories) on custom post type return no results
- Custom taxonomy wp_query woes.
- Count custom post type based on two meta data
- Remove taxonomies using register_post_type_args
- Different options per post type in WP_Query
- Custom post type permalink uses archive page to display posts
- Post type Permalink
- Add ‘page template’ column to dashboard for CPTs
- Custom Post type loop with ACF not displaying properly
- Using Wp_Query, Json to add Highcharts series data
- Display the current post in browser as the first post in a loop (for a slideshow)
- Is there a way to make child posts inherit parent post terms?
- Custom post types category
- Custom post types and custom variables — add_rewrite_tag() not working
- Add Class After 4th Post
- Display future posts in search
- custom post type template changes between preview and publish
- Custom post type post in custom menu
- Custom Taxonomy and Categories
- custom taxonomy pagination 404 error
- Excluded Custom Taxonomy Term Posts Displaying in loop
- ACF Pro Accessing fields on a Custom Post Type
- add_rewrite_rule wordpress ignoring url pattern, wp rewrite not working
- How do I change the visible tables in the CPT dashboard?
- Convert attribute woocommerce terms (taxonomy terms) in posts of custom post type
- Taxonomy template file not working with a taxonomy that contains a slash
- How might I change the destination of a link?
- Is there a best practice, or typical way to do AJAX updating for data on a custom admin screen or post.php?
- I can not call the categories of custom post type
- Custom Taxonomy page redirecting to 404 page
- Filter a custom taxonomy from displaying a button all other taxonomies can show
- Imported Content Doesnt Show Up On Frontend
- Order by post meta value gets random results
- How to load more custom type posts through AJAX & LOAD MORE POSTS button
- Add category slug as class attribute in a link array
- Custom post type – two taxonomies
- Order Custom Posts by Several Fields
- How do display gallery embedded to the custom post type
- How to change the default orderby from “Date” to e.g. “Title” or my custom column in content type records list in admin?
- Custom Post Type – Rewrite slug [duplicate]
- How to show selected value in dropdowm menu
- Post content stays the same but permalink changes ?
- Custom Post Type Permalinks with %category%
- Pagination not working with custom loop
- How to make an admin create/edit post page to look like taxonomy page?
- Looping taxonomy in taxonomy?
- Archive Page Pagination not working
- Gravity Forms Post method [closed]
- admin search of pages returns custom post types
- Trying to set up a range filter for related custom post types