This code has to be pasted into your theme’s functions.php file. It can be customized to deal with custom post types, as shown on line 16 and after.
add_filter( 'default_content', 'pu_default_editor_content' ); function pu_default_editor_content( $content ) { global $post_type; switch( $post_type ) { case 'post': $content = 'Default content for blog posts.'; break; case 'page': $content = 'Default content for pages.'; break; case 'portfolio': $content = 'Default content for your portfolio pages.'; break; case 'products': $content = 'Default content for blog posts.'; break; } return $content; }
Credit: Paulund
The post How to pre-populate WordPress editor with default content appeared first on WPRecipes.
What’s My SEO Score?
Enter the URL of any landing page or blog article and see how optimized it is for one keyword or phrase.
Latest posts by WordPress Expert (see all)
- How to Embed Instagram Feed in WordPress (5 Easy Steps) - September 26, 2023
- MemberPress vs WishList Member: Which is The Best Membership Plugin? - September 18, 2023
- 7 Best Divi Builder Alternatives for Your Website (Compared) - September 14, 2023