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
- How to remove “read more” link from custom post type excerpt
- Custom Post Types 404 Issue
- How to add custom content template part for a custom post type on main query using a plugin
- Template for specific post of custom post type
- Mandatory excerpt for custom post type
- Loading custom page template via plugin
- Templates for Custom Post Types and Custom Taxonomies
- Using Templates with Custom Post Type UI
- 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?
- Using Custom Templates for Custom Post Types for the Genesis Theme Framework?
- Custom templates for posts like for pages: page-{id} vs single-{id}
- Posts in Multiple Columns and Rows with one single loop
- Custom page type – template under page attributes?
- Display different gutenberg template from selected post attributes
- Single page template for custom post_type
- Trying to manage templates on a blog with lots of custom taxonomies
- Turn query string to sub page
- Remove header and footer but KEEP all css and js etc for a custom post template?
- WordPress Template Hierarchy
- is_page_template not working as expected
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- How to show the archive / post type description on Single templates
- Create Template for Custom Post Type same like for Page
- Set up Custom-Post-Type Author Archive
- Template for custom post with custom taxonomy
- Custom taxonomy and custom post type – wrong permalinks and template
- Can I override a CPT template on a per post basis with Gutenberg block editor?
- Content vs Template on custom post
- WordPress Doesn’t Generate Taxonomy Archive
- Custom taxonomy returns 404
- Filter widget outputs
- Adding Page Templates to post but it ignored it
- Template for all categories of a custom post type?
- Flush Rewrite Rules when new site is created on network
- WordPress custom taxonomy template not working
- Custom post type pages return 404 page?
- Template files for Custom Post Type and Taxonomy
- custom post data – how to
- Custom Empty Results page for my Custom Post Type
- Creating Sections for Post Types
- How can I trace inconsistency in loading a template?
- Assigning alternate single-{cpt} template based on blog_id in multisite
- Custom post type is using the index.php template
- Get template part with CPT and Custom Taxonomy conditionals
- Template code to split a post and print a custom field?
- Displaying a list of Contacts
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- Custom permalink structure for remote content pages
- Setting a homepage – doesn’t seem to work
- List of a specific Custom Post Type in Custom Template
- Require custom post type if is_admin() – template doesn’t show up?
- Function to allow single post template based on custom taxonomy?
- Shortcode in pages or tempate files for custom post type
- Custom Post Type, Custom Taxonomy Template: How to get current taxonomy name?
- Add custom template ‘sub-page’ to Custom Post type?
- Load info from customposttype into template page
- Custom post type defaults to index.php for archive page
- Mandatory excerpt for custom post type
- How do I force a CPT to select a shared custom template in Post Attributes?
- How can we display full post on home page rather than excerpt
- Adding specific custom fields (images) to post excerpt
- How to assign post to category
- Question on templates
- Assign for all post of a post type a specific single-post template
- Taxonomy template file not working with a taxonomy that contains a slash
- taxonomy – templates are not loading
- Custom taxonomy with custom post type template not showing
- How can I load Template file from wordpress plugin
- Templates for CPT not working
- Shortcode in excerpt
- Values show up in custom home page but not in custom post pages
- Organising custom taxonomies and custom post types
- Include template if a post is a single product
- Loading a template for a URL pattern
- How to decouple custom post types components from template?
- Custom Homepage As Single Page or Custom Post Type?
- Parent to another Custom Post Type – Template files not being recognized
- WordPress Custom taxonomy template
- erase post excerpt limitation [×]
- Excert ( the_excerpt(); ) Not working properly
- Use one template for different custom post types with the same markup
- 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
- Custom post type pagination, single page issue
- Multisite – Echo admins profile meta
- Custom template support for custom post type?
- Using custom post types within a section of a template
- Custom Post Type Template Based on Page Slug?
- Problem retrieving custom field for a custom post type
- Only One Post of Custom Post Type Appearing on Template Page
- PHP Button Custom link [closed]
- Choose custom post type template by category
- using a template for more then 1 page
- Why isn’t page attributes dropdown not showing up in a custom post type