Hi,
I have added a new custom post type to my init.php file, and I see the new type in my admin area.
if ( ! function_exists('custom_products') ) {
// Register Custom Post Type
function custom_products() {
$labels = array(
'name' => _x( 'מוצרים', 'Post Type General Name', 'text_domain' ),
'singular_name' => _x( 'מוצרים', 'Post Type Singular Name', 'text_domain' ),
'menu_name' => __( 'מוצרים', 'text_domain' ),
'parent_item_colon' => __( 'פריט אב', 'text_domain' ),
'all_items' => __( 'כל המוצרים', 'text_domain' ),
'view_item' => __( 'הצג מוצר', 'text_domain' ),
'add_new_item' => __( 'הוסף מוצר חדש', 'text_domain' ),
'add_new' => __( 'הוסף מוצר', 'text_domain' ),
'edit_item' => __( 'ערוך צוצר', 'text_domain' ),
'update_item' => __( 'עדכן מוצר', 'text_domain' ),
'search_items' => __( 'בחר מוצר', 'text_domain' ),
'not_found' => __( 'לא נמצא', 'text_domain' ),
'not_found_in_trash' => __( 'לא נמצא באשפה', 'text_domain' ),
);
$args = array(
'label' => __( 'product', 'text_domain' ),
'description' => __( 'מוצרים', 'text_domain' ),
'labels' => $labels,
'supports' => array( 'title', 'editor', 'excerpt', 'thumbnail', 'trackbacks', 'custom-fields', 'page-attributes', 'post-formats', ),
'taxonomies' => array( 'category', 'post_tag' ),
'hierarchical' => false,
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'show_in_nav_menus' => true,
'show_in_admin_bar' => true,
'menu_position' => 5,
'menu_icon' => '',
'can_export' => true,
'has_archive' => true,
'exclude_from_search' => false,
'publicly_queryable' => true,
'capability_type' => 'post',
);
register_post_type( 'product', $args );
}
// Hook into the 'init' action
add_action( 'init', 'custom_products', 0 );
}
Tried to add a few posts and see it in the category page or in a single post, but it seems like roots can not recognize the new type.
How can I add the new type to my template? I want to see the new type belong a regular posts in the category page & of course I want to allow a single-post view for my new type.
Thank you.