Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Register Custom Post Type
- function schmidthaensch_post_type() {
- $labels = array(
- 'name' => _x( 'products', 'Post Type General Name', 'schmidthaensch-theme' ),
- 'singular_name' => _x( 'product', 'Post Type Singular Name', 'schmidthaensch-theme' ),
- 'menu_name' => __( 'Products', 'schmidthaensch-theme' ),
- 'name_admin_bar' => __( 'Products', 'schmidthaensch-theme' ),
- 'parent_item_colon' => __( 'Parent Item:', 'schmidthaensch-theme' ),
- 'all_items' => __( 'All Items', 'schmidthaensch-theme' ),
- 'add_new_item' => __( 'Add New Item', 'schmidthaensch-theme' ),
- 'add_new' => __( 'Add New', 'schmidthaensch-theme' ),
- 'new_item' => __( 'New Item', 'schmidthaensch-theme' ),
- 'edit_item' => __( 'Edit Item', 'schmidthaensch-theme' ),
- 'update_item' => __( 'Update Item', 'schmidthaensch-theme' ),
- 'view_item' => __( 'View Item', 'schmidthaensch-theme' ),
- 'search_items' => __( 'Search Item', 'schmidthaensch-theme' ),
- 'not_found' => __( 'Not found', 'schmidthaensch-theme' ),
- 'not_found_in_trash' => __( 'Not found in Trash', 'schmidthaensch-theme' ),
- );
- $args = array(
- 'label' => __( 'schmidthaensch_product', 'schmidthaensch-theme' ),
- 'description' => __( 'Post Type Description', 'schmidthaensch-theme' ),
- 'labels' => $labels,
- 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),
- 'hierarchical' => false,
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'menu_position' => 5,
- 'show_in_admin_bar' => true,
- 'show_in_nav_menus' => true,
- 'can_export' => true,
- 'has_archive' => true,
- 'exclude_from_search' => false,
- 'publicly_queryable' => true,
- 'capability_type' => 'page',
- );
- register_post_type( 'schmidthaensch_product', $args );
- }
- // Hook into the 'init' action
- add_action( 'init', 'schmidthaensch_post_type', 0 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement