Default Post Content

If you want to have some Default Post Content in the BODY content area for all your new posts, copy this code to your theme’s functions.php file.

We can also check the $post_type of that ADD NEW [whatever] page, to set more specific default post content for different post types.

Code Snippet:

<?php
add_filter( 'default_content', 'mytheme_default_body_content' );
function mytheme_default_body_content( $content ) {
	global $post_type;
	switch ( $post_type ) {
		case 'post':
			$content = "&lt;p&gt;I like this to be the first paragraph of each of my blog posts&lt;/p&gt;";
			break;
		case 'page':
			$content = "&lt;p&gt;All my Pages start with this paragraph&lt;/p&gt;";
			break;
	}
	return $content;
}
?>

Posted in Admin area