Loading...
banner plugin Image
woo-image

Custom Post Template

By Simon Wheatley

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.

check-fill
Post
check-fill
Template
check-fill
Theme

FAQ

The plugin is simple to install:

  1. Download the plugin, it will arrive as a zip file
  2. Unzip it
  3. Upload custom-post-template directory to your WordPress Plugin directory
  4. Go to the plugin management page and enable the plugin
  5. Upload your post template files (see the Description for details on configuring these), and choose them through the new menu
  6. 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
Exclamation-Image

6.81

Average

Star-Image

Ratings

4.8 out of 5 | 43
History-Image

Version

1.5
calendar-Image

Last updated

8 years ago
Star-Image

Active installations

10,000+
Star-Image

WordPress version

3.4.2 or higher
php-Image

PHP version

or higher
translate-Image

Languages

0

Tags

Post,Template,Theme