I’ve a CPT that I’m making an attempt to show the mum or dad and little one class within the handle bar within the browser, however I’m having a variety of issue determining the place I’m going flawed. I’ve added a rewrite to pressure the mum or dad class identify ‘merchandise’, however I’m not positive what to do subsequent to permit the submit to show the kid class as that may must be dynamic and never set by code as it’ll change relying on the submit web page.
My CPT operate is as follows.
operate brochure_post() {
$labels = array(
'identify' => _x( 'Brochure Product', 'submit kind basic identify' ),
'singular_name' => _x( 'Brochure Product', 'submit kind singular identify' ),
'add_new' => _x( 'Add New', 'product' ),
'add_new_item' => __( 'Add New Brochure' ),
'edit_item' => __( 'Edit Brochure' ),
'new_item' => __( 'New Brochure' ),
'all_items' => __( 'All Brochures' ),
'view_item' => __( 'View Brochure' ),
'search_items' => __( 'Search Brochures' ),
'not_found' => __( 'No Brochure discovered' ),
'not_found_in_trash' => __( 'No Brochure discovered within the Trash' ),
'parent_item_colon' => '',
'menu_name' => 'Brochures',
);
$rewrite = array(
'slug' => 'merchandise',
'with_front' => false,
);
$args = array(
'labels' => $labels,
'description' => 'Holds Brochure and Brochure particular knowledge',
'public' => true,
'menu_position' => 6,
'helps' => array( 'title', 'editor', 'thumbnail', 'class', 'page-attributes' ),
'has_archive' => false,
'taxonomies' => array( 'class', 'post_tag' ),
'rewrite' => $rewrite,
);
register_post_type( 'brochures', $args );
}
add_action( 'init', 'brochure_post' );