WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Possible Duplicate:
Create more Meta Boxes as needed

I am creating a plugin that registers a Custom Post Type. Let's call it "Cars". I am looking to be able to add custom fields(or metaboxes) when I am editing a car, just like what you can do now with a custom field in a post or a CPT but I want to be able to control the HTML/CSS for it(for example I would like it to have 3 input fields). So for example when you are editing a car, there would be a "add new field" button and when you press it a new custom field/metabox(with predefined structure and styling by me) would be added.

Let me know if I am not clear. Thank you!

share|improve this question

marked as duplicate by toscho Jan 4 '13 at 23:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

This seems to answer the question wordpress.stackexchange.com/questions/19838/… – Roman Epicnerd Sharf Jan 4 '13 at 23:30
blog explaining how to achieve this, hope this helps someone.. – Coder anonymous Jan 10 at 10:41

To add a metabox to a post type car use the proper hook:

add_action( 'add_meta_boxes_car', 'register_car_metabox' );

function register_car_metabox()

        'Car data',

The content will be created in your callback:

function car_metabox_callback()
    # get post meta and print input fields
share|improve this answer
Thanks Toscho. Not quite what I was looking for though :) – Roman Epicnerd Sharf Jan 4 '13 at 23:31

Not the answer you're looking for? Browse other questions tagged or ask your own question.