custom post type does not working when adding in child theme function

try to check you functions. That function might exist somewhere in your code.
if you cant find it, then try to remove the if statement and just add your function directly like this

function testimonial() {
    register_post_type( 'testimonial',
        array(
            'labels' => array(
                'name' => 'Testimonial',
                'singular_name' => 'Testimonial',
                'add_new' => 'Add New',
                'add_new_item' => 'Add New Testimonial',
                'edit' => 'Edit',
                'edit_item' => 'Edit Testimonial',
                'new_item' => 'New Testimonial',
                'view' => 'View',
                'view_item' => 'View Testimonial',
                'search_items' => 'Search Testimonial',
                'not_found' => 'No Testimonial found',
                'not_found_in_trash' => 'No Testimonial found in Trash',
                'parent' => 'Parent Testimonial'
            ),
            'public' => true,
            'menu_position' => 15,
            'supports' => array( 'title', 'editor', 'comments', 'thumbnail', 'custom-fields' ),
            'taxonomies' => array( '' ),
            //'menu_icon' => 'T',
            'menu_icon' => plugins_url().'/images/testimonial.png',
            'has_archive' => true
        )
    );
}
add_action( 'init', 'testimonial' );