I’ve added a few different custom_post_types
to my WordPress 3 installation. They are all a bit different from eachother, and should store unique information in custom_fields
. But while one may store a product_id
, another will not. One will have a source_url
and another will not. Rather than having to instruct my editors on which custom fields should be used with which custom posts, how can I make each custom post include its custom fields as part of the UI itself?
If you visit “daily_cartoon” you would have a screen that asks only for a title, caption, and media.
If you visit “daily_product” you would have a screen that asks only for a title, price, summary, etc.
Hi @Jonathan Sampson:
There are several plugins to make Custom Post Types easier and some allow you to define Custom Fields too, in no particular order:
As I mentioned above I’ve been working on one that does not provide a User Interface like these to instead an extensible API for complex field types (and simple ones too.) But after spending an hour trying to package it I realized it’s not ready for distribution yet. Maybe in a few weeks.
These plugins listed above should meet your basic needs for now and I will try to make mine compatible with the data stored by all of these in the future in case you do decided to use mine in the future.
You also might find this post a bit of help too:
you can add meta_boxes in order to have the custom fields data stored in them.
since add_meta_box can be set according to post_type this will enable you to add different meta_box to different post types.
look at this post for a full example of altering the custom post type new/edit scree.
I have recently needed to address a very similar problem while working within a theme. The basis of the code was from this post and I had modified some of the code
The following is the first portion of the code I had modified.
The following is the second portion of the code I had modified.
If you like please send me a message and I will gladly send you my functions.php file for your reference. This is definitely the way to make it happen though as I went through many nights of hair pulling as yourself.