Yes you can define default content.
<?php
function my_default_content($content) {
$content = 'Your default content';
// $content = '<p class="example">Hello world!</p>';
return $content;
}
add_filter( 'default_content', 'my_default_content' );
?>
You can do the same for the title and the excerpt to, same as above just replacing default_content
for default_title
or default_excerpt
.
and where do I have to edit this?
functions usually reside in functions.php in your theme
In plugin form..
1. Create a new file, call it anything you like, but give the file a .php
extension (aka a php file).
2. Copy the code below into that file.
<?php
/*
Plugin Name: My Default Content
*/
function my_default_content($content) {
$content = 'Your default content'
// $content = '<p class="example">Hello world!</p>'
return $content;
}
add_filter( 'default_content', 'my_default_content' );
3. Save the file.
4. Upload to the plugins folder.
5. Activate the plugin like you would any other.
If you want to make any changes, just edit the file you’ve placed on the server (or use the builtin plugin editor if you prefer). I’ve obviously provided example HTML above, but if you need some help putting something specific into the code feel free to ask.
thank you so much! this really helped me out!