Files
2023-09-12 21:41:04 +02:00

402 lines
15 KiB
PHP

<?php
/*
* Team Section
* Author: EM40
* Author URI: http://raytheme.com
* Version: 1.0
*/
/**
* =======================================================
* KC Shortcode Map
* =======================================================
*/
add_action('init', 'em_effective_slider_sections');
if(!function_exists('em_effective_slider_sections')):
function em_effective_slider_sections(){
if(function_exists('kc_add_map')):
kc_add_map(
array(
'em_effective_slider_sections' => array(
'name' => __( 'EM Effect Slider', 'cyber' ),
'title' => 'Effect Settings',
'icon' => 'fa-photo',
'category' => 'cyber',
'wrapper_class' => 'clearfix',
'description' => __( 'Display effect_sliders layout style.', 'cyber' ),
'params' => array(
'general' => array(
array(
'type' => 'text',
'name' => 'title1',
'label' => __( 'Heading One', 'cyber' ),
'value' => 'Welcome To Leadership',
'admin_label' => true
),
array(
'type' => 'text',
'name' => 'title2',
'label' => __( 'Heading Two', 'cyber' ),
'value' => 'Web Design & Developer',
'admin_label' => true
),
array(
'type' => 'text',
'name' => 'title3',
'label' => __( 'Heading Three', 'cyber' ),
'value' => 'Multiple Expert Person',
'admin_label' => true
),
array(
'type' => 'text',
'name' => 'title4',
'label' => __( 'Heading Four', 'cyber' ),
'value' => 'Professional Developer',
'admin_label' => true
),
array(
'type' => 'textarea',
'name' => 'desc',
'label' => __( 'Description', 'cyber' ),
'value' => 'Typy your slider description here',
'admin_label' => true
),
array(
'name' => 'show_button',
'label' => __( 'Display Button', 'cyber' ),
'type' => 'toggle',
'value' => 'yes',
'relation' => array(
'parent' => 'layout',
'show_when' => array( '1', '2' )
)
),
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', '2' )
)
),
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' => 'radio_image',
'label' => __( 'Select Slider Style', 'cyber' ),
'name' => 'layout',
'admin_label' => true,
'options' => array(
'1' => EM40_EXTENSION_URI . 'asstes/images/slider/1.jpg',
'2' => EM40_EXTENSION_URI . 'asstes/images/slider/2.jpg',
),
'description' => __( 'You Set Your Slider Style First Style Is Simple and 2nd Style Is Particles ', 'cyber' ),
'value' => '1'
),
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",
'Subtitle' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.effective-content h5'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.effective-content h5'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.effective-content h5'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.effective-content h5'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.effective-content h5'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.effective-content h5'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.effective-content h5'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.effective-content h5'),
),
'Title' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.effective-content h2'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.effective-content h2'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.effective-content h2'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.effective-content h2'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.effective-content h2'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.effective-content h2'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.effective-content h2'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.effective-content h2'),
),
'Desc' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.effective-content p'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.effective-content p'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.effective-content p'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.effective-content p'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.effective-content p'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.effective-content p'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.effective-content p'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.effective-content p'),
),
'Button' => array(
array('property' => 'color', 'label' => 'Button Color', 'selector' => '.effective_slider_btn a'),
array('property' => 'color', 'label' => 'Button Hover Color', 'selector' => '.effective_slider_btn a:hover'),
array('property' => 'background-color', 'label' => 'Button BG Color', 'selector' => '.effective_slider_btn a'),
array('property' => 'background-color', 'label' => 'Button BG Hover Color', 'selector' => '.effective_slider_btn a:hover'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.effective_slider_btn a'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.effective_slider_btn a'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.effective_slider_btn a'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.effective_slider_btn a'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.effective_slider_btn a'),
array('property' => 'border', 'label' => 'Button Border', 'selector' => '.effective_slider_btn a'),
array('property' => 'border-color', 'label' => 'Button Border Color Hover', 'selector' => '.effective_slider_btn a:hover'),
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.effective_slider_btn a'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.effective_slider_btn a'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.effective_slider_btn a')
),
'Button Two' => array(
array('property' => 'color', 'label' => 'Button Color', 'selector' => '.effective_slider_btn a'),
array('property' => 'color', 'label' => 'Button Hover Color', 'selector' => '.effective_slider_btn a:hover'),
array('property' => 'background-color', 'label' => 'Button BG Color', 'selector' => '.effective_slider_btn a'),
array('property' => 'background-color', 'label' => 'Button BG Hover Color', 'selector' => '.effective_slider_btn a:hover'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.effective_slider_btn a'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.effective_slider_btn a'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.effective_slider_btn a'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.effective_slider_btn a'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.effective_slider_btn a'),
array('property' => 'border', 'label' => 'Button Border', 'selector' => '.effective_slider_btn a'),
array('property' => 'border-color', 'label' => 'Button Border Color Hover', 'selector' => '.effective_slider_btn a:hover'),
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.effective_slider_btn a'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.effective_slider_btn a'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.effective_slider_btn a')
)
)
)
)
),
'animate' => array(
array(
'name' => 'animate',
'type' => 'animate'
)
),
)
),
)// first array
); // End add map
endif;
}
endif;
/**
* =======================================================
* Register Shortcode effective_slider section
* =======================================================
*/
// [em_effective_slider_sections title="" desc="" custom_css_class=""]
if(!function_exists('em_effective_slider_section_shortcode')){
function em_effective_slider_section_shortcode($atts,$content){
ob_start();
$em_effective_slider_sections = shortcode_atts(array(
'layout' => 1,
'title1' => '',
'highl' => '',
'title2' => '',
'title3' => '',
'title4' => '',
'desc' => '',
'show_button' => '',
'button_text' => '',
'button_link' => '',
'show_button2' => '',
'button_text2' => '',
'button_link2' => '',
'subtitle' => '',
'custom_css' => '',
'custom_class' => '',
),$atts);
extract( $em_effective_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 .= '';
$data_button .= '<a class="button-active" href="'. $button_link .'">'. $button_text .'</a>';
$data_button .= '';
}
$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 .= '';
$data_button2 .= '<a href="'. $button_link2 .'">'. $button_text2 .'</a>';
$data_button2 .= '';
}
switch($layout){
case'2':
?>
<!-- INTRO -->
<section id="particles-js" class="effective-area overlay-white <?php echo esc_attr( $extra_class ); ?>">
<div class="bubble-animate">
<div class="circle small square1"></div>
<div class="circle small square2"></div>
<div class="circle small square3"></div>
<div class="circle small square4"></div>
<div class="circle small square5"></div>
<div class="circle medium square1"></div>
<div class="circle medium square2"></div>
<div class="circle medium square3"></div>
<div class="circle medium square4"></div>
<div class="circle medium square5"></div>
<div class="circle large square1"></div>
<div class="circle large square2"></div>
<div class="circle large square3"></div>
<div class="circle large square4"></div>
</div>
<div class="effective-content text-center">
<h5><?php if ( !empty( $title1 ) ) {echo $title1;} ?></h5>
<h2 class="cd-headline clip is-full-width">
<span class="cd-words-wrapper">
<b class="is-visible"><?php if ( !empty( $title2 ) ) {echo $title2;} ?></b>
<b><?php if ( !empty( $title3 ) ) {echo $title3;} ?></b>
<b><?php if ( !empty( $title4 ) ) {echo $title4;} ?></b>
</span>
</h2>
<p><?php if ( !empty( $desc ) ) {echo $desc;} ?></p>
<div class="effective_slider_btn">
<?php echo $data_button;?>
<?php echo $data_button2;?>
</div>
</div>
</section>
<!-- /INTRO -->
<?php
break;
default:
?>
<!-- INTRO -->
<section id="intro-section" class="effective-area overlay-white d-flex align-items-center <?php echo esc_attr( $extra_class ); ?>">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="effective-content text-left">
<h5><?php if ( !empty( $title1 ) ) {echo $title1;} ?></h5>
<h2 class="cd-headline clip is-full-width">
<span class="cd-words-wrapper">
<b class="is-visible"><?php if ( !empty( $title2 ) ) {echo $title2;} ?></b>
<b><?php if ( !empty( $title3 ) ) {echo $title3;} ?></b>
<b><?php if ( !empty( $title4 ) ) {echo $title4;} ?></b>
</span>
</h2>
<p><?php if ( !empty( $desc ) ) {echo $desc;} ?></p>
<div class="effective_slider_btn">
<?php echo $data_button;?>
<?php echo $data_button2;?>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- /INTRO -->
<?php
break;
}
return ob_get_clean();
}
add_shortcode('em_effective_slider_sections' ,'em_effective_slider_section_shortcode');
}