Created
August 31, 2013 20:14
-
-
Save seancojr/6400348 to your computer and use it in GitHub Desktop.
Add default post content In WordPress content editor. Source: http://smartwebworker.com/293-default-content-in-wordpress-editor/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'default_content', 'add_default_content' ); | |
function add_default_content( $content ) { | |
global $post_type; | |
switch ( $post_type ) { | |
case 'post': | |
$content = "<p>This will be the first paragraph of all new BLOGPOSTS. I am adding a default paragraph. You can add any HTML code or text.</p>"; | |
break; | |
case 'page': | |
$content = "<p>This will be the first paragraph of all new PAGES. I am adding a default paragraph. You can add any HTML code or text.</p>"; | |
break; | |
} | |
return $content; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I need default content to be displayed like dis https://web1expert.com/questions/preg_replace-the-e-modifier-is-no-longer-supported-use-preg_replace_callback-instead/ were I't answer will be like dis----we can solve dis question issue