first commit
This commit is contained in:
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/*
|
||||
* Team Section
|
||||
* Author: EM40
|
||||
* Author URI: http://raytheme.com
|
||||
* Version: 1.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* =======================================================
|
||||
* KC Shortcode Map
|
||||
* =======================================================
|
||||
*/
|
||||
|
||||
add_action('init', 'em_screenshot_slide');
|
||||
if(!function_exists('em_screenshot_slide')):
|
||||
function em_screenshot_slide(){
|
||||
if(function_exists('kc_add_map')):
|
||||
kc_add_map(
|
||||
array(
|
||||
'em_screenshot_slide' => array(
|
||||
'name' => __( 'Single Screenshot', 'cyber' ),
|
||||
'title' => 'Screenshot Slider Image',
|
||||
'icon' => 'fa-photo',
|
||||
'category' => 'cyber',
|
||||
'wrapper_class' => 'clearfix',
|
||||
'description' => __( 'Display Image style. This Elemement Only use for EM Screenshot Slider.', 'cyber' ),
|
||||
'params' => array(
|
||||
'general' => array(
|
||||
|
||||
array(
|
||||
'type' => 'attach_image',
|
||||
'name' => 'image',
|
||||
'label' => esc_html__( 'Image', 'cyber' ),
|
||||
'description' => esc_html__( 'Select image display For BG', 'cyber' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'attach_image',
|
||||
'name' => 'image2',
|
||||
'label' => esc_html__( 'Image2', 'cyber' ),
|
||||
'description' => esc_html__( 'Select image display For BG', 'cyber' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'attach_image',
|
||||
'name' => 'image3',
|
||||
'label' => esc_html__( 'Image3', 'cyber' ),
|
||||
'description' => esc_html__( 'Select image display For BG', 'cyber' ),
|
||||
),
|
||||
array(
|
||||
'type' => 'attach_image',
|
||||
'name' => 'image4',
|
||||
'label' => esc_html__( 'Image4', 'cyber' ),
|
||||
'description' => esc_html__( 'Select image display For BG', 'cyber' ),
|
||||
),
|
||||
|
||||
|
||||
|
||||
array(
|
||||
'type' => 'text',
|
||||
'label' => __( 'Custom class', 'cyber' ),
|
||||
'name' => 'custom_class',
|
||||
'description' => __( 'Enter extra custom class', 'cyber' )
|
||||
)
|
||||
),
|
||||
)
|
||||
),
|
||||
)// first array
|
||||
); // End add map
|
||||
endif;
|
||||
}
|
||||
endif;
|
||||
|
||||
|
||||
/**
|
||||
* =======================================================
|
||||
* Register Shortcode banner_slider section
|
||||
* =======================================================
|
||||
*/
|
||||
// [em_screenshot_slide title="" desc="" custom_css_class=""]
|
||||
if(!function_exists('em_screenshot_slide_function')){
|
||||
function em_screenshot_slide_function($atts,$content){
|
||||
ob_start();
|
||||
$em_screenshot_slide = shortcode_atts(array(
|
||||
'image' => '',
|
||||
'image2' => '',
|
||||
'image3' => '',
|
||||
'image4' => '',
|
||||
'custom_css' => '',
|
||||
'custom_class' => '',
|
||||
),$atts);
|
||||
extract( $em_screenshot_slide );
|
||||
//custom class
|
||||
$wrap_class = apply_filters( 'kc-el-class', $atts );
|
||||
if( !empty( $custom_class ) ):
|
||||
$wrap_class[] = $custom_class;
|
||||
endif;
|
||||
$extra_class = implode( ' ', $wrap_class );
|
||||
$images="";
|
||||
$images = wp_get_attachment_image_src( $image, 'full');
|
||||
$images2="";
|
||||
$images2 = wp_get_attachment_image_src( $image2, 'full');
|
||||
$images3="";
|
||||
$images3 = wp_get_attachment_image_src( $image3, 'full');
|
||||
$images4="";
|
||||
$images4 = wp_get_attachment_image_src( $image4, 'full');
|
||||
|
||||
|
||||
?>
|
||||
<!-- Slider Screenshort Start -->
|
||||
<div class="slider-screenshort slider-screenshot-active">
|
||||
<div class="col-lg-12">
|
||||
<!-- Singel Screenshot Start -->
|
||||
<div class="singel-screenshot">
|
||||
<?php if( !empty( $images ) ){ ?>
|
||||
<img src="<?php echo esc_url( $images[0]); ?>" alt="image" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- Singel Screenshot End -->
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<!-- Singel Screenshot Start -->
|
||||
<div class="singel-screenshot">
|
||||
<?php if( !empty( $images2 ) ){ ?>
|
||||
<img src="<?php echo esc_url( $images2[0]); ?>" alt="image" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- Singel Screenshot End -->
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<!-- Singel Screenshot Start -->
|
||||
<div class="singel-screenshot">
|
||||
<?php if( !empty( $images3 ) ){ ?>
|
||||
<img src="<?php echo esc_url( $images3[0]); ?>" alt="image" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- Singel Screenshot End -->
|
||||
</div>
|
||||
<div class="col-lg-12">
|
||||
<!-- Singel Screenshot Start -->
|
||||
<div class="singel-screenshot">
|
||||
<?php if( !empty( $images4 ) ){ ?>
|
||||
<img src="<?php echo esc_url( $images4[0]); ?>" alt="image" />
|
||||
<?php } ?>
|
||||
</div>
|
||||
<!-- Singel Screenshot End -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- Slider Screenshort End -->
|
||||
<?php
|
||||
return ob_get_clean();
|
||||
}
|
||||
add_shortcode('em_screenshot_slide' ,'em_screenshot_slide_function');
|
||||
}
|
||||
Reference in New Issue
Block a user