Skip to content

Instantly share code, notes, and snippets.

@jubalm
Created April 30, 2012 02:36
Show Gist options
  • Save jubalm/2555031 to your computer and use it in GitHub Desktop.
Save jubalm/2555031 to your computer and use it in GitHub Desktop.
wordpress - custom post type
<?php
// Add custom post type
add_action( 'init', 'create_custom_post_type' );
function create_custom_post_type() {
register_post_type( 'custom_post',
array(
'labels' => array(
'name' => __( 'Custom Posts' ),
'singular_name' => __( 'Custom Post' )
),
'public' => true,
'has_archive' => true,
'supports' => array(
'title',
'editor',
'author',
'thumbnail',
'excerpt',
'custom-fields'
)
)
);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment