This should get you going in the right direction. Not my solution, slightly modified from here.
You’ll need to swap out your-post-type
for the post type you’re using.
function adjust_post_formats() {
if (isset($_GET['post'])) {
$post = get_post($_GET['post']);
if ($post)
$post_type = $post->post_type;
} elseif ( !isset($_GET['post_type']) )
$post_type="post";
elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) )
$post_type = $_GET['post_type'];
else
return;
if ( 'your-post-type' == $post_type )
add_theme_support( 'post-formats', array( 'gallery' ) );
elseif ( 'post' == $post_type )
add_theme_support( 'post-formats', array( 'gallery', 'link', 'quote', 'audio', 'video' ) );
}
add_action( 'load-post.php','adjust_post_formats' );
add_action( 'load-post-new.php','adjust_post_formats' );
Related Posts:
- Registering different Post Formats for Blog Post and CPT
- How to set a default format for a custom post type?
- How do I add a new custom post format?
- Custom Post Formats for Custom Post Types
- Custom post types vs post formats : future-proofing – is one less “future proof” than another?
- Different post format options per custom post type?
- How can I add dropdown widget/box to admin post page?
- Strip shortcode from specific post types (formats)
- Apply post formats to a specific post type only?
- Is possible to add post-formats to custom-post-type?
- WordPress As A Shared Items Collection
- WordPress export tool doesn’t export post-format value of custom post type?
- URL of a custom post type’s post format archive?
- How can I add a filter to a particular post format?
- Is it possible to filter the display name for post formats for display in the Formats meta box?
- Understanding Post Formats/Custom Post types Etc
- Post-thumbnail only for specific post-types?
- Post format or Type for List Type Posts
- Getting Twitter Content on My Blog
- How does one go about converting custom post type to post format?
- How to add Support to show Fullwidth Featured Image of Custom Post Types in WordPress.?
- Archive of post format for Custom Post Type
- Why is my custom post type shown in the wrong place?
- Add “post option” support parameter in custom post type using Hueman Theme?
- CPT unsaved draft gives error 404 – when Post Formats support enabled
- get_post_types – exclude multiple post types by name
- Address as a content type post
- CPT Columns doesn’t show categories
- Custom post type loop with custom category filtering
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Check if user has comment on current post
- How to conditionally add Custom Post Type to Front Page
- Role capabilities issue
- Assigning a category to a custom post type in WordPress
- Insert Custom Post Types
- How to inherit field value from parent post into in child / sub post
- Create field of Custom Post Types
- Dynamically insert code to custom post type loop
- how to show records that don’t have custom meta value
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Show current custom taxonomy
- Template for custom post type when taxonomy is in the URL
- finding and using post type fields in WordPress
- One Custom post type 404’s others don’t
- sortable columns for multiple custom post types not working
- Why WordPress is picking archive.php instead of page.php?
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- post_type_link Filter – Too Few Arguments
- Custom ordering of CPT items not matching with the ordering of its pagination
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- how to get this tax_query working?
- How can I trace inconsistency in loading a template?
- Custom Post Type page sorts differently on different environments
- Select2 AJAX and WP Query Returns ALL and does not filter
- Postname on unique permalink structure appends “-2” for a custom post type. How can I get this to stop happening?
- Custom Post Type posts, conflict with posts after add_rewrite_rule to top
- hide specific div on single.php [closed]
- Is there a way to create two template for single custom post type page?
- Custom Taxonomy Search result page
- How to insert data into meta box from another plugin?
- Changing slug of all posts
- WP_Query orderby not work with meta_key
- How exclude or skip post type with get_next_post_link
- Share root slug for Child Page and Custom Post Type (prioritizing child pages over posts)
- How check if a post is saved from backend or frontend?
- Exclude Custom post type from /blog page
- Custom Permalinks For CPT and pages with parent. Advanced WordPress
- Stores category posts in an array
- echo selected value from dropdown
- CPT is simply not displayed in the main archive with “pre_get_posts”
- How to group search results by post type and only if post type result is not empty?
- How to change base in tag URL for custom post type, to not use “Custom Structure” set in Permalinks setting?
- How to integrate single and archive templates for custom post type in any WordPress theme
- set_query_params using custom params defined in functions file?
- Custom shortcode works in Elementor editor but not on frontend
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- How to see posts in taxonomy endpoint
- Graphql: Unable to query (where:{author}) for custom post type
- Combine multiple CPT names to create valid permalinks
- Permalink problems with custom post type and custom taxonomy
- Query all post and CPT from 2 specific taxonomies AND by ACF custom field
- Select other roles as custom post authors
- Pagination not working on custom query on a page
- Why does wp_update_post causes white screen?
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- How to properly delete custom post type posts programmatically
- Loop through posts of only 2 statuses
- Get terms of a post but only if they’re also the child of a specific term
- Targeting custom post type via functions.php doesn’t work
- Query within a foreach within a query (queryception)
- How to implement a different permalink structure for custom post type?
- WP API Response does not show my registered metadata
- How to create a one to many relationship in two different custom post types
- Custome fields not displayed
- sort CPT on Custom Taxonomy Archive page
- WordPress Custom Post Type – Rewrite Query
- Unable to display selected post title in frontend from metabox wp_dropdown_pages()
- Get Posts by Category, Tag , and CPT Taxonomy