內容簡介
自訂文章類型
WordPress 不僅僅只是一個部落格平臺。預設情況下,WordPress 允許您創建部落格文章和頁面(還有鏈接、評論等等)。但它可以做得更多。只要花些功夫,您就可以添加各種不同的信息。部落格文章和頁面是兩種不同類型的文章,WordPress 還允許您創建自定義文章類型。這意味著您的網站可以擁有"員工"、"產品"、"電影" 或 "超級英雄"等文章類型。
通常情況下,您需要成為一名程式猿才能完成這項工作。這需要相當多的編程知識。Postyper 希望解決這個問題。這個外掛提供了一個介面,讓您能夠定義自己的自訂文章類型,而不需要擁有電腦科學學位。
完成自訂文章類型的定義後,您需要想辦法顯示它們。Postyper 會為您創建存檔,也會為您的文章創建個別頁面。但為了顯示自訂欄位信息,您需要修改自定義模板。為此,您可能需要一位模板開發人員。
針對模板開發人員
Postyper 使用 WordPress 的本地文章元數據系統。因此,編者輸入的所有自定義信息都可以使用 get_post_meta() 或 get_post_custom() 函數檢索。您還可以使用 WordPress 的分層結構為每種文章類型創建模板,包括"single-postype.php"、"archive-postype.php" 等。
未來的更改
我們對 Postyper 的潛力感到興奮,並將繼續開發其功能。未來改進包括:
新的欄位類型:多維欄位。
分組欄位。例如,在"演員"和"電影"這種文章類型中,您會希望選擇出電影中出現的演員,以及每個演員所扮演的角色名稱。
用於顯示元數據欄位信息的短代碼。
更多欄位類型。
獨角獸。(註:此項為開發者的玩笑話)
外掛標籤
開發者團隊
原文外掛簡介
Custom Post Types
WordPress can be more than just a blog. By default, WordPress allows you to create blog posts and pages (and links, and comments,…). But it can do more than that. With a little elbow grease, you can put in all kinds of different information. Blog post and page are two different types of posts. WordPress also allows you to create custom post types. Your site could have the post type employee, or product, or movie, or super hero.
Normally, you need to be a code monkey to pull this off. If requires quite a bit of programming. Postyper aims to remedy that. It provides you with an interface to define your own custom post types, without the computer science degree.
Once you have your custom post types defined, you’ll need to work on a way to display them. Postyper creates archives for you, and individual pages for your posts. But in order to display your custom field information, you’ll need to modify your templates. For this, you’ll probably need to get a template developer.
For Template Developers
Postyper uses WordPress’s native post meta system. So all custom information entered by editors can be retrieved using the get_post_meta() or get_post_custom() functions. You can also use the WordPress hierarchy to create templates for each post type, including single-postype.php, archive-postype.php, etc.
Future Changes
We’re excited about the potential of Postyper and will continue to develop its functionality. Future improvements include:
New field type: multi-post
Group fields. For instance, with type post types, actor and movie, one would want to select with actors are in the movie, and for each actor, the name of the character they played.
Shortcodes for displaying meta field information.
More field types.
Unicorns.
