I've built a simple sales page theme and would like to enhance it a bit by allowing the input of default content (including headers, bullet points, testimonial blockquotes and the ubiquitous "add to cart" button).
What are the options for adding html snippets to content pages and/or posts?
Ideally, when I click "Add New" from the Post or Page menu, the content would already be pre-populated with the sales page default content.
Or perhaps even better, I could add a menu below the "Add New" link like "Add New Salespage" and by clicking that, it would default the sales page content.
I'd like to have a page in my theme folder called salespage.html (or salespage.txt, or salespage.php, whichever is easier to work with) and this would be the content that is used to prepopulate the editor.
Any help much appreciated.
UPDATE: Thanks to Chris_O's answer below, I was able to find the solution. I've augmented Chris suggested solution to load the content from an external file....
if (get_option("cb2_theme") == "salespage")
{
//added to support salespage creation
add_filter( 'default_content', 'my_editor_content' );
function my_editor_content( $content ) {
if(file_exists(ABSPATH.'wp-content/themes/clickbump_wp3/styles/salespage/default-content.html')){$content = file_get_contents(ABSPATH.'wp-content/themes/mytheme/styles/salespage/default-content.html');}else{$content = "Enter your salespage content here. h1-h3 tags, blockquotes etc";}
//$content = "This is some custom content I'm adding to the post editor because I hate re-typing it.";
return $content;
}
}
salespage.html
because that's what you need to that was what occurred to you? Would having a page in the admin where you could actually edit and save the default sales page be preferable? Also, do you only need one or do you maybe need many? BTW, these questions would actually augment @Chris_O's answer, not be an alternate too.