• Can anyone tell me how to add default text in the post box. It’s blank, but i want there to be default text in it. Any one know the answer?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Sure, open up the file functions.php in your theme folder and add the following code:

    function my_default_post($content)
    {
    	if (empty($content))
    		$content = "Your default text";
    	return $content;
    }
    
    add_filter('the_editor_content', 'my_default_post');

    Obviously you want to change the “Your Default Text” to whatever text you want, but you get the idea.

    You could also add this code to your wp-config.php, then it will work for any theme you use. I don’t suggest adding stuff like this to the config but at it will work. If you want, I can turn this into a plugin later, but not sure how many other people would want it.

    Any other features a plugin like this would need?

    Thread Starter mike9635

    (@mike9635)

    Thanks so much!

    I add my thanks, that was something I really needed, thanks a lot ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘adding default txt to the post box?’ is closed to new replies.