Post creation template
-
Hi,
I’m trying to set up wordpress for when you create a post (post-new.php), it loads a default template in the editor with a specific format.
The way I’m trying to do is putting a filter in the file functions.php in my theme (graphene) as follows:
————————————————————-
add_filter (‘the_editor_content’,’plantilla_entradas’);function plantilla_entradas ($the_content) {
$the_content = “”;
$the_content = $the_content . “<table width=\”100%\”>”;
.
.
.
$the_content = $the_content . “</table>”;return $the_content;
}
————————————————————-The fact is that when I go to add a new entry, is perfect, the template comes in the editor without any problem but when I go to edit a post that is already created, it overwrites the contents (it doesn’t delete them from the DB) and consequently I can not edit the post.
From what I’ve seen about the hook I’m using “the_editor_content”, that is what it makes.
My question is… is there any other hook to affect only the part of creation and not the edit one? or do you know any other way to put templates in the posts creation phase?.
Thank you very much.
Bye.
- The topic ‘Post creation template’ is closed to new replies.