(+84) 463.28.7979

How to Add Default Content in Your WordPress Post Editor

Have you ever find yourself entering the same text in all of your posts? Often people do that such as asking people to subscribe to their feeds, retweet the post, share it on facebook etc. You can always use a simple tag to add it right after the content, or you can add that text as the default content in your WordPress post editor.

Simply open up your WordPress theme’s functions.php file and paste the following code within the PHP tags ofcourse.

1 add_filter( 'default_content', 'my_editor_content' );
2 function my_editor_content( $content ) {
3 $content = "If you like this post, then please consider retweeting it or sharing it on Facebook.";
4 return $content;
5 }

And you are done. Try to create a New Post, and you should see the new content there.

Source: Justin Tadlock

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>