function create_slider_post_type()  {
   $labels = array(
     'name' => _( 'Sliders' ),
     'singular_name' => _( 'Sliders' ),
     'all_items' => _( 'All Slider' ),
     'view_item' => _( 'View Slider' ),
     'add_new_item' => _( 'Add New Slider' ),
     'add_new'   => _( 'Add New Slider' ),
     'edit_item' => _( 'Edit Slider' ),
     'update_item' => _( 'Update Slider' ),
     'search_items' => _( 'Search Slider' ),
     'search_items' => _( 'Sliders' )
);

$args = array(
  'labels' => $labels,
  'description' => 'Add New Slider contents',
  'menu_position' => 27,
  'public' => true,
  'has_archive' => true,
  'map_meta_cap' => true,
  'capability_type' => 'post',
  'hierarchical' => true,
  'rewrite' => array('slug' => false),
  'menu_icon' => 'dashicons-format-image',
  'supports' => array(
               'title',
               'thumbnail', 'excerpt'
      ),
);
register_post_type( 'slider' , $args);

}
 add_action( 'init', 'create_slider_post_type' );

add_action( 'init', function() {
   remove_post_type_support( 'slider', 'editor' );
   remove_post_type_support( 'slider', 'slug');
} );

function cih_theme_support() {
  add_theme_support( 'post-thumbnails' );
  add_image_size( 'slider_image','1024','720',true);
}
add_action('after_setup_theme','cih_theme_support');

function sliderLink_add_meta_box() {
  add_meta_box('slider_link','Slider Link','slider_link_callback','slider');
}

function slider_link_callback( $post ) {
  wp_nonce_field('slider_link_save','slider_link_meta_box_nonce');
  $value = get_post_meta($post->ID,'_slider_link_value_key',true);
?>

<input type="text" name="slider_link_field" id="slider_link_field" value="<?php e <?php

}
add_action('add_meta_boxes','sliderLink_add_meta_box');


function slider_link_save( $post_id ) {
  if( ! isset($_POST['slider_link_meta_box_nonce'])) {
  return;
}
  if( ! wp_verify_nonce( $_POST['slider_link_meta_nonce'], 'slider_link_save') ) 
   return;
}
  if( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
  return;
}
   if( ! current_user_can('edit_post', $post_id)) {
   return;
}
   if( ! isset($_POST['slider_link_field'])) {
return;
}
   $slider_link = sanitize_text_field($_POST['slider_link_field']);
update_post_meta( $post_id,'_slider_link_value_key', $slider_link );

}
add_action('save_post','slider_link_save');