Skip to content

Instantly share code, notes, and snippets.

@aarifhsn
Created August 6, 2015 05:53
Show Gist options
  • Save aarifhsn/e4699f6d155e1d750b3c to your computer and use it in GitHub Desktop.
Save aarifhsn/e4699f6d155e1d750b3c to your computer and use it in GitHub Desktop.
/**
*Custom Post Types
*/
function wpdevs_custom_post() {
register_post_type( 'news-posts',
array(
'labels' => array(
'name' => __( 'News Posts', 'hellothirteen' ),
'singular_name' => __( 'News Post', 'hellothirteen' ),
'add_new' => __( 'Add New', 'hellothirteen' ),
'add_new_item' => __( 'Add New News Post', 'hellothirteen' ),
'edit_item' => __( 'Edit News Post', 'hellothirteen' ),
'new_item' => __( 'New News Post', 'hellothirteen' ),
'view_item' => __( 'View News Post', 'hellothirteen' ),
'not_found' => __( 'Sorry, we couldn\'t find the News Post you are looking for.', 'hellothirteen' )
),
'public' => true,
'publicly_queryable' => true,
'exclude_from_search' => true,
'menu_position' => 14,
'has_archive' => true,
'hierarchical' => true,
'capability_type' => 'post',
'rewrite' => array( 'slug' => 'news-posts' ),
'supports' => array('title', 'editor', 'author','custom-fields', 'thumbnail', 'excerpt', 'comments')
)
);
}
add_action( 'init', 'wpdevs_custom_post' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment