Parent child and grand child in wordpress custom post

enter image description here

I am trying to achieve some structure to show parent, child and grand child. It show work as following. But some how my limitation i’m unable to figure it out. Following is the structure need to work.

code for my custom post type and taxonomy is as following.

function msproducts() {
    $args = array(
        'public' => true,
        'label' => 'MSProducts',
        'publicly_queryable' => true,
        'show_ui' => true,
        'show_in_menu' => true,
        'query_var' => true,
        'thumbnail' => true,
        'supports' => array( 'title', 'editor','thumbnail', 'excerpt',),
        'taxonomy' => 'category',
        'walker' => 'Walker_Category',
    );
    register_post_type( 'msproducts', $args );
}
add_action('init', 'msproducts');

function ms_products_taxonomies(){
  register_taxonomy('msproduct',array('msproducts'), array(
    'hierarchical' => true,
    'show_ui' => true,
    'show_admin_column' => true,
    'query_var' => true,
    'rewrite' => array( 'slug' => 'msproduct' ),
  ));
}
add_action( 'init', 'ms_products_taxonomies' );

please advice or guide.

Read more here: Parent child and grand child in wordpress custom post

Leave a Reply

Your email address will not be published. Required fields are marked *