Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // can someone please evaluate the code here to understand why "product" and "portfolio" not behave the same on the URLs?
- // after Testing and ReTesting again, i understand that product doesn't work for singluar "single.php" or "single-product.php"
- // meaning "domain.com/product/" and "domain.com/product/post/" take use of archive-product.php
- // but if i rename archive-product.php to archive-products.php the url "/product/" does use the archive.php but..
- // "/product/post/" show warning of " failed to open stream: No such file or directory"
- $labels = array(
- 'name' => _x('Products', 'post type general name'),
- 'singular_name' => _x('Product', 'post type singular name'),
- 'add_new' => _x('Add New', 'book'),
- 'add_new_item' => __('Add New Product'),
- 'edit_item' => __('Edit Product'),
- 'new_item' => __('New Product'),
- 'all_items' => __('All Products'),
- 'view_item' => __('View Product'),
- 'search_items' => __('Search Products'),
- 'not_found' => __('No products found'),
- 'not_found_in_trash' => __('No products found in the Trash'),
- 'parent_item_colon' => '',
- 'menu_name' => 'Products'
- );
- $args = array(
- 'labels' => $labels,
- 'description' => 'Holds our products and product specific data',
- 'public' => true,
- 'menu_position' => 5,
- //'hierarchical' => true,
- 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'comments'),
- 'rewrite' => array('slug' => 'product'),
- 'has_archive' => true
- );
- register_post_type('product', $args);
- $labels = array(
- 'name' => _x('My Portfolio', 'post type general name'),
- 'singular_name' => _x('Portfolio Item', 'post type singular name'),
- 'add_new' => _x('Add New', 'portfolio item'),
- 'add_new_item' => __('Add New Portfolio Item'),
- 'edit_item' => __('Edit Portfolio Item'),
- 'new_item' => __('New Portfolio Item'),
- 'view_item' => __('View Portfolio Item'),
- 'search_items' => __('Search Portfolio'),
- 'not_found' => __('Nothing found'),
- 'not_found_in_trash' => __('Nothing found in Trash'),
- 'parent_item_colon' => ''
- );
- $args = array(
- 'labels' => $labels,
- 'public' => true,
- 'publicly_queryable' => true,
- 'show_ui' => true,
- 'query_var' => true,
- 'menu_icon' => get_stylesheet_directory_uri() . '/article16.png',
- 'has_archive' => true,
- 'rewrite' => true,
- 'capability_type' => 'post',
- 'hierarchical' => false,
- 'menu_position' => null,
- 'supports' => array('title','editor','thumbnail')
- );
- add_theme_support('post-thumbnails');
- add_image_size('single-post-thumbnail', 400, 9999);
- register_post_type('portfolio', $args);
- register_taxonomy(
- "Skills",
- array("portfolio"),
- array(
- "hierarchical" => true,
- "label" => "Skills",
- "singular_label" => "Skill",
- "rewrite" => array('slug' => 'portfolio')
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement