Filed Under: Wordpress

Wordpress: Default Post

23 April 2008 No Comment Tags: ,

If you should come in the situation that you always need the same post over and over again, e.g. if you use wordpress as a CMS then I have a useful trick for you.

We have to edit the function “the_editor“, which is defined at general-template.php!

Open the file and find the function; now inside the function find

textarea class='mceEditor' $rows cols='40' name='$id' tabindex='2' id='$id'>%s

Straight after the %s add the text that is supposed to be your default post. If it’s a complex string you can safe the text in a variable e.g. $defaulttext = “here goes my php code”; and simply add $defaulttext after %s, but before the closing textarea tag!







Like our posts? Then subscribe via Mail:

Email:  

Similar Posts:

Socialize:

delicious stumbleupon

Leave your response!

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.com.