326 lines
12 KiB
PHP
326 lines
12 KiB
PHP
<?php
|
|
/*
|
|
* Team Section
|
|
* Author: EM40
|
|
* Author URI: http://raytheme.com
|
|
* Version: 1.0
|
|
*/
|
|
|
|
/**
|
|
* =======================================================
|
|
* KC Shortcode Map
|
|
* =======================================================
|
|
*/
|
|
|
|
add_action('init', 'em_banner_slider_sections');
|
|
if(!function_exists('em_banner_slider_sections')):
|
|
function em_banner_slider_sections(){
|
|
if(function_exists('kc_add_map')):
|
|
kc_add_map(
|
|
array(
|
|
'em_banner_slider_sections' => array(
|
|
'name' => __( 'EM Banner Slider', 'cyber' ),
|
|
'title' => 'Banner Settings',
|
|
'icon' => 'fa-photo',
|
|
'category' => 'cyber',
|
|
'wrapper_class' => 'clearfix',
|
|
'description' => __( 'Display banner_sliders layout style.', 'cyber' ),
|
|
'params' => array(
|
|
'general' => array(
|
|
array(
|
|
'type' => 'text',
|
|
'name' => 'title1',
|
|
'label' => __( 'Heading 1', 'cyber' ),
|
|
'value' => 'Welcome To ',
|
|
'admin_label' => true
|
|
),
|
|
array(
|
|
'name' => 'highl',
|
|
'label' => __( 'Highlight Text', 'cyber' ),
|
|
'type' => 'text',
|
|
'value' => 'cyber.'
|
|
),
|
|
array(
|
|
'type' => 'text',
|
|
'name' => 'title2',
|
|
'label' => __( 'Heading 2', 'cyber' ),
|
|
'value' => 'Creative Multipurpose WP Theme',
|
|
'admin_label' => true
|
|
),
|
|
array(
|
|
'type' => 'textarea',
|
|
'name' => 'desc',
|
|
'label' => __( 'Description', 'cyber' ),
|
|
'value' => base64_encode('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut laboret dolore magna aliqua. Ut en ad minim ullamco laboris nisi ut aliquip.')
|
|
),
|
|
array(
|
|
'name' => 'show_button',
|
|
'label' => __( 'Display Button', 'cyber' ),
|
|
'type' => 'toggle',
|
|
'value' => 'yes',
|
|
'relation' => array(
|
|
'parent' => 'layout',
|
|
'show_when' => array( '1', '3' )
|
|
)
|
|
),
|
|
array(
|
|
'name' => 'button_text',
|
|
'label' => __( 'Text Button', 'cyber' ),
|
|
'type' => 'text',
|
|
'value' => __( 'Contact us', 'cyber' ),
|
|
'relation' => array(
|
|
'parent' => 'show_button',
|
|
'show_when' => 'yes'
|
|
)
|
|
),
|
|
array(
|
|
'name' => 'button_link',
|
|
'label' => __( 'Link Button', 'cyber' ),
|
|
'type' => 'link',
|
|
'value' => '#',
|
|
'relation' => array(
|
|
'parent' => 'show_button',
|
|
'show_when' => 'yes'
|
|
)
|
|
),
|
|
array(
|
|
'name' => 'show_button2',
|
|
'label' => __( 'Display Button Two', 'cyber' ),
|
|
'type' => 'toggle',
|
|
'value' => 'yes',
|
|
'relation' => array(
|
|
'parent' => 'layout',
|
|
'show_when' => array( '1', '3' )
|
|
)
|
|
),
|
|
array(
|
|
'name' => 'button_text2',
|
|
'label' => __( 'Text Button Two', 'cyber' ),
|
|
'type' => 'text',
|
|
'value' => __( 'About Us', 'cyber' ),
|
|
'relation' => array(
|
|
'parent' => 'show_button',
|
|
'show_when' => 'yes'
|
|
)
|
|
),
|
|
array(
|
|
'name' => 'button_link2',
|
|
'label' => __( 'Link Button Two', 'cyber' ),
|
|
'type' => 'link',
|
|
'value' => '#',
|
|
'relation' => array(
|
|
'parent' => 'show_button',
|
|
'show_when' => 'yes'
|
|
)
|
|
),
|
|
|
|
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 one' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.banner-content h1'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.banner-content h1'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.banner-content h1'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.banner-content h1'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.banner-content h1'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.banner-content h1'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.banner-content h1'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.banner-content h1'),
|
|
),
|
|
'Subtitle' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.redX,.scroll-next i'),
|
|
),
|
|
'Title Two' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.banner-content h2'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.banner-content h2'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.banner-content h2'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.banner-content h2'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.banner-content h2'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.banner-content h2'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.banner-content h2'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.banner-content h2'),
|
|
),
|
|
'Desc' => array(
|
|
array('property' => 'color', 'label' => 'Color', 'selector' => '.banner-content p'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.banner-content p'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.banner-content p'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.banner-content p'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.banner-content p'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.banner-content p'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.banner-content p'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.banner-content p'),
|
|
),
|
|
'Button' => array(
|
|
array('property' => 'color', 'label' => 'Button Color', 'selector' => '.btn'),
|
|
array('property' => 'color', 'label' => 'Button Hover Color', 'selector' => '.btn:hover'),
|
|
array('property' => 'background-color', 'label' => 'Button BG Color', 'selector' => '.btn'),
|
|
array('property' => 'background-color', 'label' => 'Button BG Hover Color', 'selector' => '.btn:hover'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.btn'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.btn'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.btn'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.btn'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.btn'),
|
|
array('property' => 'border', 'label' => 'Button Border', 'selector' => '.btn'),
|
|
array('property' => 'border-color', 'label' => 'Button Border Color Hover', 'selector' => '.btn:hover'),
|
|
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.btn'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.btn'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.btn')
|
|
),
|
|
'Button Two' => array(
|
|
array('property' => 'color', 'label' => 'Button Color', 'selector' => '.btn'),
|
|
array('property' => 'color', 'label' => 'Button Hover Color', 'selector' => '.btn:hover'),
|
|
array('property' => 'background-color', 'label' => 'Button BG Color', 'selector' => '.btn'),
|
|
array('property' => 'background-color', 'label' => 'Button BG Hover Color', 'selector' => '.btn:hover'),
|
|
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.btn'),
|
|
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.btn'),
|
|
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.btn'),
|
|
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.btn'),
|
|
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.btn'),
|
|
array('property' => 'border', 'label' => 'Button Border', 'selector' => '.btn'),
|
|
array('property' => 'border-color', 'label' => 'Button Border Color Hover', 'selector' => '.btn:hover'),
|
|
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.btn'),
|
|
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.btn'),
|
|
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.btn')
|
|
)
|
|
)
|
|
)
|
|
)
|
|
),
|
|
'animate' => array(
|
|
array(
|
|
'name' => 'animate',
|
|
'type' => 'animate'
|
|
)
|
|
),
|
|
)
|
|
),
|
|
)// first array
|
|
); // End add map
|
|
endif;
|
|
}
|
|
endif;
|
|
|
|
|
|
/**
|
|
* =======================================================
|
|
* Register Shortcode banner_slider section
|
|
* =======================================================
|
|
*/
|
|
// [em_banner_slider_sections title="" desc="" custom_css_class=""]
|
|
if(!function_exists('em_banner_slider_section_shortcode')){
|
|
function em_banner_slider_section_shortcode($atts,$content){
|
|
ob_start();
|
|
$em_banner_slider_sections = shortcode_atts(array(
|
|
'layout' => 1,
|
|
'title1' => '',
|
|
'highl' => '',
|
|
'title2' => '',
|
|
'subtitle' => '',
|
|
'desc' => '',
|
|
'show_button' => '',
|
|
'button_text' => '',
|
|
'button_link' => '',
|
|
'show_button2' => '',
|
|
'button_text2' => '',
|
|
'button_link2' => '',
|
|
|
|
'custom_css' => '',
|
|
'custom_class' => '',
|
|
),$atts);
|
|
extract( $em_banner_slider_sections );
|
|
//custom class
|
|
$wrap_class = apply_filters( 'kc-el-class', $atts );
|
|
if( !empty( $custom_class ) ):
|
|
$wrap_class[] = $custom_class;
|
|
endif;
|
|
$extra_class = implode( ' ', $wrap_class );
|
|
|
|
$data_button="";
|
|
|
|
|
|
if ( $show_button == 'yes' ) {
|
|
|
|
if ( !empty( $button_link ) ) {
|
|
$button_link_text = explode( '|', $button_link );
|
|
$button_link = $button_link_text[0];
|
|
}
|
|
|
|
if( empty($button_text) )
|
|
$button_text = __( 'Readmore', 'cyber' );
|
|
$data_button .= '<a class="btn btn-lg" href="'. $button_link .'">'. $button_text .'</a>';
|
|
|
|
|
|
}
|
|
|
|
$data_button2="";
|
|
|
|
|
|
if ( $show_button2 == 'yes' ) {
|
|
|
|
if ( !empty( $button_link2 ) ) {
|
|
$button_link_text = explode( '|', $button_link2 );
|
|
$button_link2 = $button_link_text[0];
|
|
}
|
|
|
|
if( empty($button_text2) )
|
|
$button_text2 = __( 'About Us', 'cyber' );
|
|
$data_button2 .= '<a class="btn btn-lg" href="'. $button_link2 .'">'. $button_text2 .'</a>';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|
|
|
|
|
|
<!-- INTRO -->
|
|
<section class="banner-slider-area bnrsk d-flex align-items-center <?php echo esc_attr( $extra_class ); ?>">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-md-12 col-lg-12 col-sm-12">
|
|
<div class="banner-slider-content ">
|
|
<h1><?php if ( !empty( $title1 ) ) {echo $title1;} ?><span class="redX"><?php if ( !empty( $highl ) ) {echo $highl;}?></span></h1>
|
|
<h2><?php if ( !empty( $title2 ) ) {echo $title2;} ?></h2>
|
|
|
|
<p><?php if ( !empty( $desc ) ) {echo $desc;} ?></p>
|
|
<div class="bannar_slider_button">
|
|
<?php echo $data_button;?>
|
|
<?php echo $data_button2;?>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- /INTRO -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
|
return ob_get_clean();
|
|
}
|
|
add_shortcode('em_banner_slider_sections' ,'em_banner_slider_section_shortcode');
|
|
}
|