public
Created

my registered WP custom post, it does not work any longer since wp updated to 3.6

  • Download Gist
my registered WP custom post
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*------ #Add custom portfolio post type------*/
add_action( 'init', 'create_my_post_types' );
 
function create_my_post_types() {
register_post_type( 'Portfolio',
array(
'labels' => array(
'name' => __( 'Portfolio' ),
'singular_name' => __( 'Portfolio' ),
'add_new' => __('Add a new work'),
),
'public' => true,
'exclude_from_search' => true,
'taxonomies' => array('post_tag', 'category'),
'menu_position' => 4,
'query_var' => true,
'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail' ),
'menu_icon' => get_bloginfo('template_directory') . '/images/portfolio_icon_default_16x16.png',
)
);
}
my superCPT codes
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
/*------ #Add Super Custom Post Meta------*/
function my_portfolio() {
if ( ! class_exists( 'Super_Custom_Post_Type' ) )
return;
// All your SuperCPT magic goes here!
$post_meta = new Super_Custom_Post_Meta('Portfolio');
$post_meta->add_meta_box(array(
'id' => 'project_detail',
'title' => 'Project Detail',
'fields' => array(
'brief' => array( 'label' => 'Project Brief', 'type' => 'textarea'),
'client' => array( 'label' => 'Client', 'type' => 'text' ),
'project' => array( 'label' => 'Project', 'type' => 'text' ),
'date' => array( 'label' => 'Date', 'type' => 'text' ),
'role' => array( 'label' => 'Role', 'type' => 'text' ),
'credit' => array( 'label' => 'Credit', 'type' => 'text' ),
'site_link' => array( 'label' => 'Site Link', 'type' => 'url'),
'display_image' => array( 'label' => 'URL of project display image', 'type' => 'text'),
'display_video' => array( 'label' => '(Animation) Display Video HTML Editor', 'type' => 'wysiwyg'),
'showcase_image' => array( 'label' => '(Optional) URL of Showcase Image', 'type' => 'text' ),
'showcase_copy' => array( 'label' => '(Optional) Showcase Copy', 'type' => 'textarea' )
)
));
}
add_action( 'after_setup_theme', 'my_portfolio' );

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.