- Registering post type in function.php
- Create custom related pages.
- Settings->Permalinks [Update]
Done!
Let's start...
- Modifie, functions.php (in child theme) to register Custom Post Type
1234567891011121314add_action( 'init', 'create_post_type' );function create_post_type() {register_post_type( 'mycompany_product',array('labels' => array('name' => __( 'Products' ),'singular_name' => __( 'Product' )),'public' => true,'has_archive' => true,'rewrite' => array('slug' => 'products'),));} - Create custom template files (copy and rename archive.php and single.php as below)
- single posts of a custom post type will use single-mycompany_product.php
- and their archives will use archive-mycompany_product.php
- Navigate in WP-Admin menu to: Settings->Permalinks. Update page, this will rewrite .htaccess
For more check Creating WordPress Custom Post Type | Advanced