這個外掛並未在最新的 3 個 WordPress 主要版本上進行測試。開發者可能不再對這個外掛進行維護或提供技術支援,並可能會與更新版本的 WordPress 產生使用上的相容性問題。

Custom Post Type Template Redirect

描述

One of the shortcomings of Custom Post Types in WordPress is that there’s no way to easily set a different custom template from the standard single.php. If it’s a custom post type, it’s got custom information, and I want to put it in a custom template!

So I threw together a plugin to handle this. With this plugin installed and activated, it checks your template directory for posttype.php then t_posttype.php. If neither exists, then the standard WP template rules take effect.

For example, if your custom post type is ‘books’, it’s going to check your template directory for ‘books.php’. If it finds it, it will use that as the template for your ‘books’ posts. If not, it will check for ‘t_books.php’, and use that as the template for your ‘books’ posts. If it finds neither, the standard WP logic kicks into place, looking to see if you’ve defined a template for the post, and, if not, using single.php.

安裝

Simply install and activate this plugin, then start putting your templates for custom post types into your theme’s directory using the naming structure above.

常見問題

Does this plugin create new custom post types?

No, it only changes the order in which WP looks for the template file to display posts belonging to a custom post type.

評價

There are no reviews for this plugin.

貢獻者及開發者

“Custom Post Type Template Redirect” 是一個開源的軟體。以下的人對這個外掛作出了貢獻。

貢獻者