344 lines
14 KiB
PHP
344 lines
14 KiB
PHP
<?php
|
|
|
|
add_action('init', 'cyber_slider_sections');
|
|
|
|
if(!function_exists('cyber_slider_sections')):
|
|
|
|
function cyber_slider_sections(){
|
|
|
|
if(function_exists('kc_add_map')):
|
|
|
|
kc_add_map(
|
|
|
|
array(
|
|
|
|
'cyber_slider' => array(
|
|
'name' => esc_html__('EM Slider', 'cyber'),
|
|
'description' => esc_html__('Display Slider Style', 'cyber'),
|
|
'icon' => 'kc-icon-testi',
|
|
'category' => 'cyber',
|
|
'params' => array(
|
|
|
|
|
|
'General' => array(
|
|
array(
|
|
'name' => 'items',
|
|
'label' => __( 'Items Limit', 'cyber' ),
|
|
'type' => 'number_slider',
|
|
'value' => '30',
|
|
'description' => __(' Specify number of post that you want to show. Set 0 to get all team', 'cyber'),
|
|
'options' => array(
|
|
'min' => 0,
|
|
'max' => 40,
|
|
'unit' => '',
|
|
'show_input' => false
|
|
)
|
|
),
|
|
array(
|
|
'type' => 'select',
|
|
'label' => __( 'Order By', 'cyber' ),
|
|
'name' => 'order',
|
|
'options' => array(
|
|
'DESC' => __( 'Descending', 'cyber' ),
|
|
'ASC' => __( 'Ascending', 'cyber' )
|
|
)
|
|
),
|
|
array(
|
|
'type' => 'text',
|
|
'label' => __( 'Custom class', 'cyber' ),
|
|
'name' => 'custom_class',
|
|
'description' => __( 'Enter extra custom class', 'cyber' )
|
|
)
|
|
|
|
),
|
|
'styling' => array(
|
|
array(
|
|
'name' => 'css_custom',
|
|
'type' => 'css',
|
|
'options' => array(
|
|
array(
|
|
"screens" => "any,1024,999,767,479",
|
|
|
|
'Title' => array(
|
|
array('property' => 'color', 'label' => esc_html__('Color','cyber'), 'selector' => '+ .em-slider-title'),
|
|
array('property' => 'font-size', 'label' => esc_html__('Font Size','cyber'), 'selector' => '+ .em-slider-title'),
|
|
array('property' => 'font-weight', 'label' => esc_html__('Font Weight','cyber'), 'selector' => '+ .em-slider-title'),
|
|
array('property' => 'text-transform', 'label' => esc_html__('Text Transform','cyber'), 'selector' => '+ .em-slider-title'),
|
|
array('property' => 'letter-spacing', 'label' => esc_html__('Letter Spacing','cyber'), 'selector' => '+ .em-slider-title'),
|
|
array('property' => 'margin', 'label' => esc_html__('Margin','cyber'),'selector' => '+ .em-slider-title'),
|
|
array('property' => 'padding', 'label' => esc_html__('Padding','cyber'),'selector' => '+ .em-slider-title'),
|
|
array('property' => 'display', 'label' => esc_html__('Display','cyber'),'selector' => '+ .em-slider-title'),
|
|
),
|
|
'Title Two' => array(
|
|
array('property' => 'color', 'label' => esc_html__('Color','cyber'), 'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'font-size', 'label' => esc_html__('Font Size','cyber'), 'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'font-weight', 'label' => esc_html__('Font Weight','cyber'), 'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'text-transform', 'label' => esc_html__('Text Transform','cyber'), 'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'letter-spacing', 'label' => esc_html__('Letter Spacing','cyber'), 'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'margin', 'label' => esc_html__('Margin','cyber'),'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'padding', 'label' => esc_html__('Padding','cyber'),'selector' => '+ .em-slider-sub-title'),
|
|
array('property' => 'display', 'label' => esc_html__('Display','cyber'),'selector' => '+ .em-slider-sub-title'),
|
|
),
|
|
'Highligh Text' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '+ .em-slider-title span,.em-slider-sub-title span'),
|
|
),
|
|
'Desc' => array(
|
|
array('property' => 'color', 'label' => esc_html__('Color','cyber'), 'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'font-size', 'label' => esc_html__('Font Size','cyber'), 'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'font-weight', 'label' => esc_html__('Font Weight','cyber'), 'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'text-transform', 'label' => esc_html__('Text Transform','cyber'), 'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'letter-spacing', 'label' => esc_html__('Letter Spacing','cyber'), 'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'margin', 'label' => esc_html__('Margin','cyber'),'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'padding', 'label' => esc_html__('Padding','cyber'),'selector' => '+ .em-slider-descript'),
|
|
array('property' => 'display', 'label' => esc_html__('Display','cyber'),'selector' => '+ .em-slider-descript'),
|
|
),
|
|
'Button' => array(
|
|
array('property' => 'color', 'label' => 'Text Color', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'border', 'label' => 'Border', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'border-color', 'label' => 'Hover Border', 'selector' => '+ .em-button-button-area a:hover'),
|
|
array('property' => 'background-color', 'label' => 'Background Color', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+ .em-button-button-area a:hover'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '+. em-button-button-area a'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '+ .em-button-button-area a'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '+ .em-button-button-area a'),
|
|
),
|
|
'Button Active' => array(
|
|
array('property' => 'border-color', 'label' => 'Hover Border', 'selector' => '+ a.em-active-button'),
|
|
array('property' => 'background-color', 'label' => 'Background Color', 'selector' => '+ a.em-active-button'),
|
|
),
|
|
'Arrow' => array(
|
|
array('property' => 'color', 'label' => 'Text Color', 'selector' => '+ .nivo-directionNav a'),
|
|
array('property' => 'color', 'label' => 'Text Hover Color', 'selector' => '+ .nivo-directionNav a:hover'),
|
|
array('property' => 'border', 'label' => 'Border', 'selector' => '+ .nivo-directionNav a'),
|
|
array('property' => 'border-color', 'label' => 'Hover Border', 'selector' => '+ .nivo-directionNav a:hover'),
|
|
array('property' => 'background-color', 'label' => 'BG Color', 'selector' => '+ .nivo-controlNav a.active,+ .nivo-directionNav a'),
|
|
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+ .nivo-directionNav a:hover, + .nivo-controlNav a:hover'),
|
|
)
|
|
|
|
)
|
|
)
|
|
)
|
|
),
|
|
'animate' => array(
|
|
array(
|
|
'name' => 'animate',
|
|
'type' => 'animate'
|
|
)
|
|
),
|
|
|
|
|
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
endif;
|
|
|
|
}
|
|
|
|
endif;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!function_exists('cyber_slider_area')){
|
|
function cyber_slider_area( $atts , $content = null ){
|
|
|
|
ob_start();
|
|
$em_slider_box = shortcode_atts(array(
|
|
'layout' => '1',
|
|
'show_carousel' => '',
|
|
'post_type' => '',
|
|
'items' => '-1',
|
|
'order' => '',
|
|
'custom_css' => '',
|
|
'custom_class' => '',
|
|
),$atts);
|
|
extract( $em_slider_box );
|
|
|
|
|
|
|
|
//custom class
|
|
$wrap_class = apply_filters( 'kc-el-class', $atts );
|
|
if( !empty( $custom_class ) ):
|
|
$wrap_class[] = $custom_class;
|
|
endif;
|
|
$extra_class = implode( ' ', $wrap_class );
|
|
|
|
|
|
$args = array(
|
|
'post_type' => 'em_slider',
|
|
'posts_per_page' => intval( $items ),
|
|
'order' => $order,
|
|
);
|
|
$post_query = new WP_Query($args);
|
|
|
|
|
|
|
|
if( $post_query->have_posts() ) { ?>
|
|
|
|
|
|
<!-- SLIDER AREA -->
|
|
<div class="main-slider-area">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="em-nivo-slider-wrapper <?php echo esc_attr($extra_class);?>">
|
|
<div id="mainSlider" class="nivoSlider em-slider-image">
|
|
|
|
<?php while ( $post_query->have_posts() ) {
|
|
$post_query->the_post();
|
|
?>
|
|
|
|
<?php $em_slider_caption = '#htmlcaption1_'.get_the_ID(); ?>
|
|
<?php if(has_post_thumbnail() ) { ?>
|
|
|
|
<?php the_post_thumbnail('em-thumb',array('title' => ''.$em_slider_caption.'')); ?>
|
|
|
|
<?php } ?>
|
|
<?php } ?>
|
|
|
|
</div>
|
|
|
|
<?php while ( $post_query->have_posts() ) {
|
|
$post_query->the_post();
|
|
|
|
|
|
$em_slide_title = get_post_meta( get_the_ID(),'_cyber_em_slide_title', true );
|
|
$em_slide_subtitle = get_post_meta( get_the_ID(),'_cyber_em_slide_subtitle', true );
|
|
$em_slide_textarea = get_post_meta( get_the_ID(),'_cyber_em_slide_textarea', true );
|
|
$em_slide_btn1 = get_post_meta( get_the_ID(),'_cyber_em_slide_btn1', true );
|
|
$em_slide_btn1utl = get_post_meta( get_the_ID(),'_cyber_em_slide_btn1utl', true );
|
|
$em_slide_btn2 = get_post_meta( get_the_ID(),'_cyber_em_slide_btn2', true );
|
|
$em_slide_btn2url = get_post_meta( get_the_ID(),'_cyber_em_slide_btn2url', true );
|
|
$em_slider_posi = get_post_meta( get_the_ID(),'_cyber_em_slider_posi', true );
|
|
|
|
|
|
$em_aimate_title = get_post_meta( get_the_ID(),'_cyber_em_aimate_title', true );
|
|
$em_durations_title = get_post_meta( get_the_ID(),'_cyber_em_durations_title', true );
|
|
$em_dealy_title = get_post_meta( get_the_ID(),'_cyber_em_dealy_title', true );
|
|
|
|
|
|
$em_aimate_image = get_post_meta( get_the_ID(),'_cyber_em_aimate_image', true );
|
|
$em_durations_image = get_post_meta( get_the_ID(),'_cyber_em_durations_image', true );
|
|
$em_dealy_image = get_post_meta( get_the_ID(),'_cyber_em_dealy_image', true );
|
|
|
|
|
|
$em_aimate_subtitle = get_post_meta( get_the_ID(),'_cyber_em_aimate_subtitle', true );
|
|
$em_durations_subtitle = get_post_meta( get_the_ID(),'_cyber_em_durations_subtitle', true );
|
|
$em_dealy_subtitle = get_post_meta( get_the_ID(),'_cyber_em_dealy_subtitle', true );
|
|
|
|
$em_aimate_content = get_post_meta( get_the_ID(),'_cyber_em_aimate_content', true );
|
|
$em_durations_content = get_post_meta( get_the_ID(),'_cyber_em_durations_content', true );
|
|
$em_dealy_content = get_post_meta( get_the_ID(),'_cyber_em_dealy_content', true );
|
|
|
|
$em_aimate_btn = get_post_meta( get_the_ID(),'_cyber_em_aimate_btn', true );
|
|
$em_durations_btn = get_post_meta( get_the_ID(),'_cyber_em_durations_btn', true );
|
|
$em_dealy_btn = get_post_meta( get_the_ID(),'_cyber_em_dealy_btn', true );
|
|
$em_slide_image = get_post_meta( get_the_ID(),'_cyber_em_slide_img', true );
|
|
$em_slide_video_icon = get_post_meta( get_the_ID(),'_cyber_youtube_video', true );
|
|
|
|
|
|
|
|
|
|
|
|
?>
|
|
<!-- em_slider style-1 start -->
|
|
<div id="htmlcaption1_<?php the_ID(); ?>" class="nivo-html-caption em-slider-content-nivo">
|
|
<div class="em_slider_inner container <?php if($em_slider_posi){echo $em_slider_posi;}?>">
|
|
|
|
<?php if($em_slide_title){?>
|
|
|
|
<div class="wow <?php if($em_aimate_title){ echo $em_aimate_title;} ?>" data-wow-duration="<?php if($em_durations_title){ echo $em_durations_title;} ?>s" data-wow-delay="<?php if($em_dealy_title){ echo $em_dealy_title;} ?>s">
|
|
|
|
<h2 class="em-slider-title"><?php echo $em_slide_title;?></h2>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
<?php if($em_slide_subtitle){?>
|
|
<div class="wow <?php if($em_aimate_subtitle){ echo $em_aimate_subtitle;} ?>" data-wow-duration="<?php if($em_durations_subtitle){ echo $em_durations_subtitle;} ?>s" data-wow-delay="<?php if($em_dealy_subtitle){ echo $em_dealy_subtitle;} ?>s">
|
|
|
|
<h1 class="em-slider-sub-title"><?php echo $em_slide_subtitle;?>
|
|
</h1>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
|
|
<?php if($em_slide_textarea){?>
|
|
|
|
<div class="wow <?php if($em_aimate_content){ echo $em_aimate_content;} ?>" data-wow-duration="<?php if($em_durations_content){ echo $em_durations_content;} ?>s" data-wow-delay="<?php if($em_dealy_content){ echo $em_dealy_content;} ?>s">
|
|
|
|
<p class="em-slider-descript"><?php echo esc_html($em_slide_textarea);?></p>
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
|
|
<div class="em-slider-button wow <?php if($em_aimate_btn){ echo $em_aimate_btn;} ?> em-button-button-area" data-wow-duration="<?php if($em_durations_btn){ echo $em_durations_btn;} ?>s" data-wow-delay="<?php if($em_dealy_btn){ echo $em_dealy_btn;} ?>s">
|
|
|
|
<?php if($em_slide_btn1utl){?>
|
|
<a class="em-active-button" href="<?php echo esc_url( $em_slide_btn1utl );?>"><?php echo esc_html( $em_slide_btn1 );?></a>
|
|
<?php }?>
|
|
|
|
<?php if($em_slide_btn2url){?>
|
|
<a class="withput-active" href="<?php echo esc_url( $em_slide_btn2url );?>"><?php echo esc_html( $em_slide_btn2 );?></a>
|
|
<?php }?>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
<div class="single_slide_img">
|
|
<?php if($em_slide_image){?>
|
|
|
|
<div class="wow <?php if($em_aimate_image){ echo $em_aimate_image;} ?>" data-wow-duration="<?php if($em_durations_image){ echo $em_durations_title;} ?>s" data-wow-delay="<?php if($em_dealy_image){ echo $em_dealy_image;} ?>s">
|
|
|
|
<img src="<?php echo $em_slide_image ?>" alt="" />
|
|
|
|
</div>
|
|
|
|
<?php } ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- em_slider style-1 end -->
|
|
<?php } ?>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php }
|
|
return ob_get_clean();
|
|
}
|
|
}
|
|
add_shortcode ('cyber_slider', 'cyber_slider_area' );
|