1function custom_post_type() {
2 $labels = array(
3 'name' => _x( 'Movies', 'Post Type General Name', 'twentythirteen' ),
4 'singular_name' => _x( 'Movie', 'Post Type Singular Name', 'twentythirteen' ),
5 'menu_name' => __( 'Movies', 'twentythirteen' ),
6 'parent_item_colon' => __( 'Parent Movie', 'twentythirteen' ),
7 'all_items' => __( 'All Movies', 'twentythirteen' ),
8 'view_item' => __( 'View Movie', 'twentythirteen' ),
9 'add_new_item' => __( 'Add New Movie', 'twentythirteen' ),
10 'add_new' => __( 'Add New', 'twentythirteen' ),
11 'edit_item' => __( 'Edit Movie', 'twentythirteen' ),
12 'update_item' => __( 'Update Movie', 'twentythirteen' ),
13 'search_items' => __( 'Search Movie', 'twentythirteen' ),
14 'not_found' => __( 'Not Found', 'twentythirteen' ),
15 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),
16 );
17
18
19 $args = array(
20 'label' => __( 'movies', 'twentythirteen' ),
21 'description' => __( 'Movie news and reviews', 'twentythirteen' ),
22 'labels' => $labels,
23 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),
24 'hierarchical' => true,
25 'public' => true,
26 'show_ui' => true,
27 'show_in_menu' => true,
28 'show_in_nav_menus' => true,
29 'show_in_admin_bar' => true,
30 'menu_position' => 5,
31 'can_export' => true,
32 'has_archive' => true,
33 'exclude_from_search' => false,
34 'publicly_queryable' => true,
35 'capability_type' => 'page',
36 'show_in_rest' => true,
37
38 // This is where we add taxonomies to our CPT
39 'taxonomies' => array( 'category' ),
40 );
41
42 // Registering your Custom Post Type
43 register_post_type( 'movies', $args );
44
45}
46
47
48add_action( 'init', 'custom_post_type', 0 );
49
1add_action( 'init', 'create_news' );
2function create_news ()
3{
4 register_post_type( 'ecommerces',
5 array(
6 'labels' => array(
7 'name' => __( 'Ecommerces' ),
8 'singular_name' => __( 'Ecommerce' )
9 ),
10 'public' => true,
11 'supports' => array ('title', 'editor', 'thumbnail')
12 )
13 );
14
15 register_taxonomy(
16 'ecommerce_cat',
17 'ecommerces',
18 array(
19 'labels' => array(
20 'name' => 'Ecommerce Categories',
21 'add_new_item' => 'Add New Ecommerce Category',
22 'new_item_name' => "New Ecommerce Category"
23 ),
24 'show_ui' => true,
25 'show_tagcloud' => false,
26 'hierarchical' => true,
27 'hasArchive' => true
28 )
29 );
30
31 }
32
33 if ( function_exists( 'add_theme_support' ) ) {
34 add_theme_support( 'post-thumbnails' );
35 set_post_thumbnail_size( 100, 100, true );
36}
37
38 ?>
1function create_posttype() {
2 register_post_type( 'wpll_product',
3 array(
4 'labels' => array(
5 'name' => __( 'Products' ),
6 'singular_name' => __( 'Product' )
7 ),
8 'public' => true,
9 'has_archive' => true,
10 'rewrite' => array('slug' => 'products'),
11 )
12 );
13}
14add_action( 'init', 'create_posttype' );
15