add_filter( 'the_content', 'check_empty_postcontent', 0, 99 ); // filter post content
add_filter( 'the_excerpt', 'check_empty_postcontent', 0, 99 ); // filter excerpt content
function check_empty_postcontent( $content ) {
global $post;
$post_type = get_post_type( $post->ID );
return ( empty( $content ) && 'seriale' === strtolower( $post_type ) ) ?
'No content available' : $content;
}
There are a lot of articles about that in the web.
Related Posts:
- Can I assign a template to a custom post type?
- Get custom post_type’s archive URL
- single-{$post_type}-{slug}.php for custom post types
- Searching multiple custom post types and pages
- display different template based on post type
- How to remove “read more” link from custom post type excerpt
- Taxonomy, Terms, and Template Files
- previous_post_link() and next_post_link() with a custom post type?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- tag.php doesn’t work with tags on a custom post type post?
- Setting a custom sub-path for blog without using pages?
- Custom Post Types 404 Issue
- How to add custom content template part for a custom post type on main query using a plugin
- Assign single template to multiple custom post types?
- Template for specific post of custom post type
- Mandatory excerpt for custom post type
- How do I filter the excerpt metabox description in admin?
- Add Content to Page without shortcodes
- How do I display two separate taxonomy archives for two post types that share a single taxonomy?
- Loading custom page template via plugin
- Multiple Single Post templates
- How to set a fall back template for a custom post type in a plugin?
- Templates for Custom Post Types and Custom Taxonomies
- Using Templates with Custom Post Type UI
- Get page by template?
- Custom taxonomy query for a custom post type
- Apply template to custom post type
- Page is defaulting to archive page and not designated template
- How to quickly switch custom post type singular template?
- How to list/show all custom post types regardless of category?
- Custom Post Type Archive URL takes over page URL
- Need some templating advice for templating with custom post types and taxonomies
- How to query custom posts using a dynamic category
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom Post Type with Nested Taxonomy and Template Files
- Custom Post Type Archive Template
- Custom templates for posts like for pages: page-{id} vs single-{id}
- Posts in Multiple Columns and Rows with one single loop
- Create Pages from Database
- Custom page type – template under page attributes?
- Template tags to display custom post type posts in category template?
- How do I create new content pages for my Custom Post Type?
- Display different gutenberg template from selected post attributes
- Clean URL permalink for custom post type
- custom post type archive template per custom taxonomy term
- where can I see my custom post type archive template?
- Custom post type loops with different page templates
- Display posts of child category in template
- custom taxonomy – Template not working
- Include different loop templates in search query
- Create separate template for shared custom taxonomy with shared terms
- Single page template for custom post_type
- erase post excerpt limitation [×]
- Excert ( the_excerpt(); ) Not working properly
- Use one template for different custom post types with the same markup
- How to avoid hardcoded text in a custom page template?
- Custom page template not being called
- How to display custom post types AND regular posts separately on a shared taxonomy archive?
- Querying multiple taxonomies in URL leads to wrong taxonomy archive
- Load different template for CPT (in loop) in my plugin?
- Excerpt for each post type and for is_front_page
- Search page for custom post type
- How can I pull information from my loop and divide them seperately?
- Custom post type pagination, single page issue
- Multisite – Echo admins profile meta
- Having some trouble properly displaying Custom Post Types in templates
- Add Excerpt On Quicksand Plugin
- Custom template support for custom post type?
- Storing postID in session variable to query database when visitor on custom template page
- query_post while (have post) get_template_part()?
- Custom Post Type Template based on Taxonomy
- Template with Custom Post Type (Custom Tables) does not work
- Using custom post types within a section of a template
- Listing all custom post types using a specific term on the said term’s template page, in groups
- Specifying Default Template for Hierarchal Custom Post Type [duplicate]
- Most appropriate way to display CPT’s by children terms of custom taxonomies while retaining desired permalink structure?
- Custom Post Type Template Based on Page Slug?
- how to pass args for archive.php query?
- Navigation links to posts in current term shortcode
- How to make a template for a specific post of a custom post type?
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- CPT Template Option to Top
- WP_Query is getting the post but the_post() not rendering any Post
- Apply text based styling done for a single post in WPBakery to all posts / create a template out of it [closed]
- Show my custom post id if a country or ip
- PHP Button Custom link [closed]
- How to create custom page templates with default page layout framework?
- Choose custom post type template by category
- using a template for more then 1 page
- Custom Post Types using wrong template (index) instead of archive-{type}.php – previously worked as expected
- Custom post type is_singular condtional not working when managing sidebar display
- Why isn’t page attributes dropdown not showing up in a custom post type
- How can I produce multiple webpages with a different output based on one entry/Page/custom Page?
- How to check if a custom post type uses a custom template?
- Custom post type template not loading from plugin
- How can I allow plugin users to define layouts for a custom post type
- How to change layout of post types templates dynamically for separate posts?
- Custom PHP Template in Twenty Twenty-Four
- Add block templates (html) via plugin for custom post type