Custom Post Template
Description
This plugin provides a drop-down to select different templates for posts from the post edit screen. The templates are defined similarly to page templates and will replace single.php for the specified post. This plugin will NOT switch the templates for the different posts in a listing page, such as a date or category archive; it will only affect the template used for single posts.
Post templates, as far as this plugin is concerned, are configured similarly to page templates in that they have a particular style of PHP comment at the top of them. Each post template must contain the following, or similar, at the top:
<?php
/*
Template Name Posts: Snarfer
*/
?>
First note: Page templates use 'Template Name:', whereas post templates use 'Template Name Posts:'.
Second note: You must have the custom post template files in your theme in the same directory as your index.php template file, not in a sub-directory.
If you want to implement the custom post templates on a custom post type, you can use the cpt_post_types filter. Here’s an example of adding the custom post template selector and metabox to the 'Movie' and 'Actor' custom post types. This code can be added to a plugin or to the functions.php file in your theme.
Other Notable Features
Here are a few other notable features of this free Custom Post Template plugin.
FAQ
The plugin is simple to install:
- Download the plugin, it will arrive as a zip file
- Unzip it
- Upload
custom-post-templatedirectory to your WordPress Plugin directory - Go to the plugin management page and enable the plugin
- Upload your post template files (see the Description for details on configuring these), and choose them through the new menu
- Give yourself a pat on the back
Contributors and developers
“Custom Post Template” is open source software. The following people have contributed to this plugin.
WPS
6.81
Average
Ratings
4.8 out of 5 | 43Version
1.5Last updated
8 years agoActive installations
10,000+WordPress version
3.4.2 or higherPHP version
or higherLanguages
0Tags
Post,Template,ThemeOther plugins you might like
Classic Editor
By WordPress.org
WPS
7.65
Very Good
1.2k+reviews
active installation
Tested with
6.9.4Yoast Duplicate Post
By Yoast
WPS
7.7
Very Good
529+reviews
active installation
Tested with
6.9.4Advanced Editor Tools
By Andrew Ozz
WPS
7.53
Very Good
353+reviews
active installation
Tested with
6.9.4Advanced Custom Fields (ACF®)
By WP Engine
WPS
7.55
Very Good
1.4k+reviews
active installation
Tested with
6.9.4Custom Post Type UI
By webdevstudios
WPS
7.68
Very Good
273+reviews
active installation
Tested with
6.9.4TablePress – Tables in WordPress made easy
By Tobias Bäthge
WPS
7.55
Very Good
4.6k+reviews
active installation
Tested with
7.0