Skip to content

Commit

Permalink
Updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
rmartindotco committed Apr 16, 2012
1 parent 4f89c0d commit 66820a2
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions readme.md
Expand Up @@ -4,4 +4,42 @@ This is a Custom Post type helper for WordPress to easily create custom post typ

##Install

Include the class in your `functions.php` and add the css and js into template directory.

##Usage

To add a custom post type simply call the CP_Helper and pass a name

$car = new CP_Helper( 'Car' );

If you want to override defaults

$car = new CP_Helper( 'Car',
array( 'supports' => array( 'title', 'editor', 'excerpt' ) )
);

### Add Custom taxonomies

To add Custom Taxonomies, simply call the add_taxonomy.

$car->add_taxonomy( 'Model' );

###Add Metaboxes

First argument is the title of the meta box and the second you must pass an array for each field.

$car->add_meta_box(
'Car Info', array(
array(
'name' => 'Car Image',
'label' => 'Car Image',
'desc' => 'Please select an image',
'type' => 'image',
),
array(
'name' => 'Car Description',
'label' => 'Car Description',
'desc' => 'Please enter a description for the car',
'type' => 'wyiwyg',
),
));

0 comments on commit 66820a2

Please sign in to comment.