Snippet: Pre-populating content for new posts or pages

Add following snippet to “functions.php”

Snippet

add_filter( 'default_content', 'prepopulated_contents' );
function prepopulated_contents( $content ) {
    global $post_type;

    switch( $post_type ) {
        case 'post': 
            $content = 'Write your post...';
			break;
        case 'post': 
            $content = 'Add page content';
			break;
     }
    return $content;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>