Advanced Content Templates provides a simple, easy-to-use post content template system to WordPress. Instead of opening an old post for editing, copying and pasting various details into a new post and saving, you can create a post template and load it automatically (or manually) every time you create a new post!
Example: Say you’re a photographer who blogs about your wedding shoots. It’s likely that each one of these posts will have a similar format, with the same general outline and content. With Advanced Content Templates, you could create a template called Wedding Shoots, and load it anytime you’re posting about a wedding.
Going further, if you have specific templates that should be used for specific content types, you can have your templates automatically loaded each time a new post is added to that post type.
Example: Say you have a ‘Book Reviews’ post type. You could create a ‘Book Review’ template that is loaded each time you click ‘Add New Book Review’. Magically!
Better yet, Advanced Content Templates supports every aspect of a WordPress post. Here are the fields you can set in your templates:
- Taxonomies (tags, categories, custom)
- Featured Image
- Post Format
- Custom Fields
- Page Template (only works for pages)
- Page Order
Beyond this, you can even use PHP inline in your templates to create content that is dynamically generated each time the template is loaded.
Example: You could automatically insert the date into a ‘Recipe of the Month’ post title.
Are you ready for this? It’s about to get really intense. Try these steps on for size:
- Unzip downloaded zip file and upload advanced-content-templates folder to /wp-content/plugins/
- Go to Plugins and click “Activate” next to Advanced Content Templates.
The Advanced Content Templates settings page is accessible by going to Content Templates -> Settings. It looks like this:
To receive support and updates, you’ll need to enter your license key (provided at purchase) and save your key settings. This will reveal a button that will allow you to activate the current site. The number of activations you receive depends on the license you purchased.
Post Type Settings
Each public post type (ie, one that has a menu) will show up with a checkbox and a dropdown. The checkbox adds a Advanced Content Templates metabox to the edit / create screens for that post type, allowing you to load a content template manually.
The dropdown lets you set a content template that will load automatically every time you create a new post of that type. This will initially be empty as you’ll need to create a template!
<?php echo date('m'); ?>
This bit of PHP will be executed and the month will appear in its place each time you load the template.
There are a great many uses for this feature, but it is disabled by default since any adhoc execution of PHP is a security risk by default. You should only enable this at your own risk, and when you absolutely trust your authors!
Creating Content Templates
Adding a new post content template with Advanced Content Templates is no different than writing a new new post. Simply find the new “Content Templates” menu in WordPress Admin and click “Add Template”:
You’ll be presented with a new post screen that is identical to the normal WordPress new post screen.
The only new things you’ll see on this screen that you may not otherwise expect is the “Template” and “Attributes” metaboxes on the right.
Both of these meta boxes are on the New Page editor in WordPress, and can really only be used with Pages in WordPress. The template dropdown (I know, it’s confusing to have a ‘template’ dropdown on a ‘New Template’ screen ) allows you to select a page template, just like you would on the new page screen.
The Attributes box allows you to set a page order. This should work for all content types in WordPress, but it’s usually reserved for pages so your mileage may vary. This normally let’s you to control the order pages show up, but theoretically can be used for posts too. This is probably an edge case feature since it’s unlikely you’ll want to assign a particular order to all new posts.
Other than this, all the rest should be completely familiar. You can select tags, categories, images, custom fields, etc using the same technique you would editing a normal post. When you’re done, just click “Publish”!
- Refactored license handling code.
- Seems not everyone wants the post_title to be excluded from updates if it already has a value. Consequently, I’ve setup a filter so you can easily do this yourself: https://gist.github.com/clifgriffin/28fbaa5c4eb663ab200e
- Ok, but seriously. We’re going to get this right this time. Post title now is only set if an existing title is not in place.
- Don’t set post title of target post if post title is already set. (Exception to overwrite rule)
- Loosen search for post types to include posts that have exclude_from_search set to true. More post types should now work with ACT!
- Fix dreaded updater issue.
- Fixed issue with Simple Post Template upgrade sequence.
- Fixed error with anonymous functions and older versions of PHP.
- Fixed warnings and notices.
- Initial release.
If you have problems, the preferred way to get support is to contact me through my contact page.