Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Prefilled Post in Wordpress WordPress

Good day to all,

I created my Wordpress "blog" as a method of keeping track of structures for me in my courses. I would like to have it where when I click on "New Post" that the following content is already in the post
<h3>AKA</h3>
<p>N/A</p>
<h3>Code</h3>
<p>N/A</p>
<h3>Function</h3>
<p>N/A</p>
<h3>Afferent</h3>
<p>N/A</p>
<h3>Efferent</h3>
<p>N/A</p>
<h3>Definition</h3>
<p>N/A</p>
<h3>Interesting Notes</h3>
<p>N/A</p>
<h3>Images</h3>
<p>Add images here</p>


Here is a video demonstrating what I am attempting to do (can be viewed in HD).

[[LINK href="http://youtu.be/72RLi8cz3R8"]][[/LINK]]
http://youtu.be/72RLi8cz3R8


Thanks to anyone with ideas.

Answers (5)

2011-12-15

Maor Barazany answers:

add_filter( 'default_content', 'tc_default_content' );
function tc_default_contentt($content) {


$default = '<h3>AKA</h3>
<p>N/A</p>
<h3>Code</h3>. ......etc
';
return $default;
}


Maor Barazany comments:

I've forgot to write, put this snippet in your theme's functions.php file

2011-12-15

Manoj Raj answers:

paste this is functions.php

add_filter( 'default_content', 'my_editor_content' );
function my_editor_content( $content ) {
$content = "<h3>AKA</h3>

<p>N/A</p>

<h3>Code</h3>

<p>N/A</p>

<h3>Function</h3>

<p>N/A</p>

<h3>Afferent</h3>

<p>N/A</p>

<h3>Efferent</h3>

<p>N/A</p>

<h3>Definition</h3>

<p>N/A</p>

<h3>Interesting Notes</h3>

<p>N/A</p>

<h3>Images</h3>

<p>Add images here</p>";
return $content;
}

2011-12-15

Josh Eaton answers:

This plugin may do the trick for you:

[[LINK href="http://wordpress.org/extend/plugins/default-post-content/"]]http://wordpress.org/extend/plugins/default-post-content/[[/LINK]]

2011-12-16

Julio Potier answers:

Hello

i understand you need and the 3 answers before me are right.

But if i analyse you question, i can tell you this :
A day you will need to change your theme and maybe that the actual structure <h3>...</h3><p>...</p>... won't be the correst struture you need.
Maybe you will need to list with <ul><li> or <div><span> or other tags.
Or a day you will need to translate the title, or you will need to change the order of entries, or need to add a new entry...

And this day, you'll want to die because all of your posts must be reworked.
See what i mean ?
I tell you this because i made this mistake ...

And the best solution is to use the post meta.
I suggest you to create as many as meta you want, in any order.
Then in your single.php template you can grab all meta datas, print them in any order, any language, any format.
(And do not forget to add a filter to the_exerpt for RSS)

VoilĂ  !

I can do this of course, but not for $5. I think it can be done in about 1h. Contact me if you want me to do this.

See you !


missionman comments:

I'm intrigued by this suggestion of yours. If I am correct the previous methods will work, however it will do so for every post I have already created. Is that correct?

The method you describe would not do this. If possible, could you elaborate on the advantages and disadvantages of the method you propose and state your cost, I'm willing to invest in my site since I use it so often


Julio Potier comments:

Ok, i'll do this tomorrow ;)


Julio Potier comments:

OK so with my solution :

+++ are :
- Very flexible : you can remove, add, change order of entries (an "entry" for me is like AKA, Code...)
- You can change the CSS easily
- You can change your theme easily
- You can change your page/post template easily
- You can build your own excerpt for website and/or RSS feed based on your entries
- You can use different templates for cat or page or archives etc with same datas/entries
- You can query posts using your entries in where clauses !
- You don't have to use the solutions above, just use a page/post template

--- are :
- You have to modify your old posts before using this system ( +++ but never need to modify later ;))

With the other solutions, if you need to change your css, theme, template : YOU CAN NOT
Or each time your want, you'll have to modify again all your posts.

See you soon (ps you can PM me ;) )

2011-12-16

Francisco Javier Carazo Gil answers:

You can also make your own plugin in order to activate or deactivate it. You create a file called "mydefaultplugin.php" in "/wp-content/plugins/" and paste this code:


<?php
/* Plugin Name: MyDefaultContent
Plugin URI: http://your_url.com/plugin
Description: Turn
Version: 1.0
Author: The WP Questions Experts
Author URI: http://www.wpquestions.com
License: GPLv3 */

add_filter( 'default_content', 'my_editor_content' );

function my_editor_content( $content ) {
$content = "<h3>AKA</h3>
<p>N/A</p>

<h3>Code</h3>
<p>N/A</p>

<h3>Function</h3>
<p>N/A</p>

<h3>Afferent</h3>
<p>N/A</p>

<h3>Efferent</h3>
<p>N/A</p>

<h3>Definition</h3>
<p>N/A</p>

<h3>Interesting Notes</h3>
<p>N/A</p>

<h3>Images</h3>
<p>Add images here</p>";

return $content;
}
?>


Hope it helps!