I am trying to create a filter in my custom post type- I have created a custom post type with the name of ourrecipes.. you can check the code below for custom post type- function ourrecipes_posttype() {
register_post_type( 'ourrecipes',
// CPT Options
array(
'labels' => array(
'name' => __( 'Ourrecipes' ),
'singular_name' => __( 'Ourrecipes' )
),
'public' => true,
'taxonomies' => array('category','post_tag'),
'has_archive' => true,
'rewrite' => array('slug' => 'ourrecipes'),
'supports' => array( 'title','thumbnail' ,'editor','excerpt','custom-fields','page-attributes')
)
);
}
// Hooking up our function to theme setup add_action( 'init', 'ourrecipes_posttype' );
For the reference please check the design as well-