I’m working on Custom Post Type and Genesis Child Theme. My code is
add_action( 'init', 'register_cpt_testimonial' );
function register_cpt_testimonial() {
$labels = array(
'name' => _x( 'Testimonials', 'testimonial' ),
'singular_name' => _x( 'Testimonial', 'testimonial' ),
'add_new' => _x( 'Add New', 'testimonial' ),
'add_new_item' => _x( 'Add New Testimonial', 'testimonial' ),
'edit_item' => _x( 'Edit Testimonial', 'testimonial' ),
'new_item' => _x( 'New Testimonial', 'testimonial' ),
'view_item' => _x( 'View Testimonial', 'testimonial' ),
'search_items' => _x( 'Search Testimonials', 'testimonial' ),
'not_found' => _x( 'No testimonials found', 'testimonial' ),
'not_found_in_trash' => _x( 'No testimonials found in Trash', 'testimonial' ),
'parent_item_colon' => _x( 'Parent Testimonial:', 'testimonial' ),
'menu_name' => _x( 'Testimonials', 'testimonial' ),
);
$args = array(
'labels' => $labels,
'hierarchical' => true,
'supports' => array( 'title', 'thumbnail' ),
'public' => true,
'show_ui' => true,
'show_in_menu' => true,
'menu_position' => 10,
'show_in_nav_menus' => true,
'publicly_queryable' => true,
'exclude_from_search' => false,
'has_archive' => true,
'query_var' => true,
'can_export' => true,
'rewrite' => true,
'capability_type' => 'post'
);
register_post_type( 'testimonial', $args );
}
If I pasted the codes into function.php of Genesis Framework, worked for me. But when I used the codes into function.php of a Genesis Child, nothing was happened. Please help me to find out the mistake I made.