このプラグインは WordPress の最新3回のメジャーリリースに対してテストされていません。もうメンテナンスやサポートがされていないかもしれず、最新バージョンの WordPress で使用した場合は互換性の問題が発生する可能性があります。

Single Post Template

説明

The Single Post Template plugin adds the ability for your theme to include “Post Templates” in much the same way you can add “Page Templates”, allowing you to choose (via a simple dropdown) which post template you want to use, on a per-post basis.

All you need to do, after installing and activating the plugin, is create one or more “Post Templates” in your theme’s folder, and when creating or editing a post, choose the post template that you would like to use. If no post template is selected, the default template will be used.

1.2

  • Minor update

1.3

  • Copied methodology of WordPress get_page_templates() function
  • Added 2.9 compatibility
  • Ensured 2.8 backward compatibility

1.4

  • Compatibility with up to WordPress 3.6
  • Build a class for better namespacing and to avoid conflicts with Genesis

1.4.1

  • Fix admin bug

1.4.2

  • Fix bugs, feel sorry for myself

1.4.3

  • Fix another bug, loathe myself

1.4.4

  • Fix issue with default template not loading

スクリーンショット

  • This is what the top of your new Post Templates should look like
  • This is the new box that this plugin adds to your post edit screen

インストール

Installation

  1. Upload the entire single-post-template folder to the /wp-content/plugins/ directory
  2. WordPress の「プラグイン」メニューからプラグインを有効化してください
  3. Create Post Templates in your theme’s folder, as described in Usage

Usage

After you have installed the plugin, you’ll need to create some Post Templates to use. In order to create a Post Template, either duplicate your default single post template, or create a new template file. Insert the following code at the very top of the file:

<?php
/*
Single Post Template: [Descriptive Template Name]
Description: This part is optional, but helpful for describing the Post Template
*/
?>

See Screenshot #1 for what this might look like in your code editor

Once you have created a new Post Template, either edit or create a new post, and directly underneath the post content box, you should see a new box labeled “Single Post Template”. Choose the Post Template you want to use and publish or update the post.

See Screenshot #2 for what this might look like in your post edit screen

FAQ

Installation Instructions

Installation

  1. Upload the entire single-post-template folder to the /wp-content/plugins/ directory
  2. WordPress の「プラグイン」メニューからプラグインを有効化してください
  3. Create Post Templates in your theme’s folder, as described in Usage

Usage

After you have installed the plugin, you’ll need to create some Post Templates to use. In order to create a Post Template, either duplicate your default single post template, or create a new template file. Insert the following code at the very top of the file:

<?php
/*
Single Post Template: [Descriptive Template Name]
Description: This part is optional, but helpful for describing the Post Template
*/
?>

See Screenshot #1 for what this might look like in your code editor

Once you have created a new Post Template, either edit or create a new post, and directly underneath the post content box, you should see a new box labeled “Single Post Template”. Choose the Post Template you want to use and publish or update the post.

See Screenshot #2 for what this might look like in your post edit screen

How do I create new Post Templates?

Please see the Installation -> Usage section for details on how to create new Post Templates.

How do I use the Post Templates I created?

Please see the Installation -> Usage section for details on how to use Post Templates.

Can I include this plugin in my theme for distribution?

Yes. Source credits for the plugin should remain intact, per GPL requirements.

How do I include this plugin in my theme for distribution?

If you don’t know how to do this, you will need to contact me for instructions. I do charge a consulting fee for this service.

I have a question that wasn’t covered in the FAQ. Can I contact you?

Please email me or @nathanrice me on Twitter.

Because I try to offer personal email support, I do ask that you compensate me for the time I spend helping you. This can run anywhere from $10 for simple support, up to $125 for more complex issues or use cases.

Bug reports are, of course, appreciated and cost you nothing. I will try to make sure bugs are fixed ASAP.

評価

Fais ce qu’il dit de façon excellente

WordPress 5.1.1 L'extension est toujours d'actualité. Très simplement : Pour créer un nouveau template d'article, dupliquez single.php le renommer par exemple :single-cuisine.php A l'intérieur insérer le code php décrit par l'auteur en remplaçant le texte entre crochets par le nom du nouveau fichier (single-cuisine.php) Et hop le tour est joué. Lorsque vous créez une nouvelle page, vous avez une liste de choix avec les différents templates que vous avez créé. Merci à l'auteur pour cet excellent plugin. Laurent de Coudenhove
14件のレビューをすべて表示

貢献者と開発者

Single Post Template はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

“Single Post Template” をあなたの言語に翻訳しましょう。

開発に興味がありますか ?

コードを閲覧するか、SVN リポジトリをチェックするか、開発ログRSS で購読してみてください。

変更履歴

1.0

  • 最初のリリース

1.1

  • Changed some function and variable names for consistency
  • Ensured WordPress 2.8+ compatibility
  • Fixed a bug that presents when you include the plugin in your WordPress theme’s folder