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

350 lines
13 KiB
PHP

<?php
/*
* Team Section
* Author: EM40
* Author URI: http://webitkurigram.com
* Version: 1.0
*/
/**
* =======================================================
* KC Shortcode Map
* =======================================================
*/
add_action('init', 'em_about_us');
if(!function_exists('em_about_us')):
function em_about_us(){
if(function_exists('kc_add_map')):
kc_add_map(
array(
'em_about_us' => array(
'name' => __( 'EM About Us', 'cyber' ),
'title' => 'About Us Settings',
'icon' => 'et-target',
'category' => 'cyber',
'wrapper_class' => 'clearfix',
'description' => __( 'Display About Us Style.', 'cyber' ),
'params' => array(
'general' => array(
array(
'type' => 'toggle',
'label' => esc_html__( 'Set Image', 'themexp' ),
'name' => 'show_image',
'value' => 'no',
'description' => esc_html__( 'set bg image.', 'themexp' )
),
array(
'name' => 'image',
'label' => __( 'Avatar Image', 'cyber' ),
'type' => 'attach_image',
'relation' => array(
'parent' => 'show_image',
'show_when' => 'yes'
)
),
array(
'type' => 'text',
'label' => __( 'Image Size', 'cyber' ),
'name' => 'img_size',
'value' => 'full',
'description' => __(' Set the image size: "full", "thumbnail", "medium", "large" or other size ', 'cyber'),
),
array(
'type' => 'text',
'name' => 'title',
'label' => __( 'Name', 'cyber' ),
'value' => 'Are you ready to working with us?',
'admin_label' => true
),
array(
'type' => 'text',
'name' => 'subtitle',
'label' => __( 'Sub Title', 'cyber' ),
'value' => 'Sub Title Name',
'admin_label' => true
),
array(
'type' => 'textarea',
'name' => 'desc',
'label' => __( 'Description', 'cyber' ),
'value' => base64_encode('Minim enim ad minim veniam, quis ercitation ullamco laboris nisi ut aliquip ex ea laboris nisi ut aliquip commodo consequat. Duis aute')
),
array(
'name' => 'show_button',
'label' => __( 'Display Button', 'cyber' ),
'type' => 'toggle',
'value' => 'yes',
),
array(
'name' => 'button_text',
'label' => __( 'Text Button', 'cyber' ),
'type' => 'text',
'value' => __( 'Read More', '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(
'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' => 'Color', 'selector' => '.em_about_us_title h2'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em_about_us_title h2'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em_about_us_title h2'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em_about_us_title h2'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em_about_us_title h2'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em_about_us_title h2'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em_about_us_title h2'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em_about_us_title h2'),
),
'Sub Title' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.em_about_us_title span'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em_about_us_title span'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em_about_us_title span'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em_about_us_title span'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em_about_us_title span'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em_about_us_title span'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em_about_us_title span'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em_about_us_title span'),
),
'Desc' => array(
array('property' => 'color', 'label' => 'Color', 'selector' => '.about_us_description'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.about_us_description'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.about_us_description'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.about_us_description'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.about_us_description'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.about_us_description'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.about_us_description'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.about_us_description'),
),
'Social' => array(
array('property' => 'color', 'label' => 'Icon Color', 'selector' => '.em-about-content-socials a'),
array('property' => 'color', 'label' => 'Icon Color Hover', 'selector' => '.em-about-content-socials a:hover'),
array('property' => 'background-color', 'selector' => '.em-about-content-socials a'),
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '.em-about-content-socials a:hover'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em-about-content-socials a'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em-about-content-socials a'),
array('property' => 'width', 'label' => 'Width', 'selector' => '.em-about-content-socials a'),
array('property' => 'height', 'label' => 'Height', 'selector' => '.em-about-content-socials a'),
array('property' => 'border', 'label' => 'Border', 'selector' => '.em-about-content-socials a'),
array('property' => 'border-color', 'label' => 'Border Color Hover', 'selector' => '.em-about-content-socials a:hover'),
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.em-about-content-socials a'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em-about-content-socials a'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em-about-content-socials a'),
),
'Button' => array(
array('property' => 'color', 'label' => 'Button Color', 'selector' => '.em_about_us_button > a'),
array('property' => 'color', 'label' => 'Button Hover Color', 'selector' => '.em_about_us_button > a:hover'),
array('property' => 'background-color', 'label' => 'Button BG Color', 'selector' => '.em_about_us_button > a'),
array('property' => 'background-color', 'label' => 'Button BG Hover Color', 'selector' => '.em_about_us_button > a:hover'),
array('property' => 'font-family', 'label' => 'Font Family', 'selector' => '.em_about_us_button > a'),
array('property' => 'font-size', 'label' => 'Font Size', 'selector' => '.em_about_us_button > a'),
array('property' => 'line-height', 'label' => 'Line Height', 'selector' => '.em_about_us_button > a'),
array('property' => 'font-weight', 'label' => 'Font Weight', 'selector' => '.em_about_us_button > a'),
array('property' => 'text-transform', 'label' => 'Text Transform', 'selector' => '.em_about_us_button > a'),
array('property' => 'border', 'label' => 'Button Border', 'selector' => '.em_about_us_button > a'),
array('property' => 'border-color', 'label' => 'Button Border Color Hover', 'selector' => '.em_about_us_button > a:hover'),
array('property' => 'border-radius', 'label' => 'Border Radius', 'selector' => '.em_about_us_button > a'),
array('property' => 'margin', 'label' => 'Margin', 'selector' => '.em_about_us_button > a'),
array('property' => 'padding', 'label' => 'Padding', 'selector' => '.em_about_us_button > a')
),
'Box' => array(
array('property' => 'background'),
array('property' => 'background-color', 'label' => 'BG Color Hover', 'selector' => '+:hover'),
array('property' => 'text-align', 'label' => 'Box Text Align'),
array('property' => 'border', 'label' => 'Border'),
array('property' => 'border-color', 'label' => 'Border Color Hover'),
array('property' => 'display', 'label' => 'Display'),
array('property' => 'border-radius', 'label' => 'Border Radius'),
array('property' => 'box-shadow', 'label' => 'Box Shadow', 'selector' => '+.em-call-to-action'),
array('property' => 'box-shadow', 'label' => 'Box Shadow Hover', 'selector' => '+.em-call-to-action:hover'),
array('property' => 'margin', 'label' => 'Margin'),
array('property' => 'padding', 'label' => 'Padding'),
array('property' => 'margin', 'label' => 'Position Hover', 'selector' => '+.em-call-to-action:hover')
)
)
)
)
),
'animate' => array(
array(
'name' => 'animate',
'type' => 'animate'
)
),
)
),
)// first array
); // End add map
endif;
}
endif;
/**
* =======================================================
* Register Shortcode team section
* =======================================================
*/
// [em_about_us title="" desc="" icon=""]
if(!function_exists('em_about_us_shortcode')){
function em_about_us_shortcode($atts,$content){
ob_start();
$em_about_us = shortcode_atts(array(
'show_image' => '',
'image' => '',
'subtitle' => '',
'title' => '',
'desc' => '',
'facebook' => '',
'twitter' => '',
'google_plus' => '',
'flickr' => '',
'linkedin' => '',
'pinterest' => '',
'instagram' => '',
'dribbble' => '',
'email' => '',
'reddit' => '',
'show_button' => '',
'button_text' => '',
'button_link' => '',
'custom_css' => '',
'custom_class' => '',
),$atts);
extract( $em_about_us );
//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_title=$data_subtitle=$data_desc=$data_button=$data_img=$img_size=$img_link="";
$size_array = array('full', 'medium', 'large', 'thumbnail');
if ( !empty( $title ) ) {
$data_title .= '<div class="em_about_us_title"><h2>';
$data_title .= $title;
$data_title .= '</h2></div>';
}
if ( !empty( $subtitle ) ) {
$data_subtitle .= '<div class="em_about_us_title"><h3>';
$data_subtitle .= $subtitle;
$data_subtitle .= '</h3></div>';
}
if ( !empty( $desc ) ) {
$data_desc .= '<div class="about_us_description">';
$data_desc .= $desc;
$data_desc .= '</div>';
}
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 .= '<div class="em_about_us_button">';
$data_button .= '<a href="'. $button_link .'">'. $button_text .'</a>';
$data_button .= '</div>';
}
if ( !empty( $image ) ) {
if( in_array( $img_size, $size_array ) ){
$image_data = wp_get_attachment_image_src( $image, $img_size );
$img_link = $image_data[0];
}else{
$image_full_width = wp_get_attachment_image_src( $image, 'full' );
$img_link = kc_tools::createImageSize( $image_full_width[0], $img_size );
}
}
?>
<div class="em_about_us <?php echo esc_attr( $extra_class ); ?>">
<?php if($show_image=='yes' && !empty($image)){?>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="em_about_us_thumb">
<img src="<?php echo $img_link; ?>" alt="">
</div>
</div>
<?php } else{?>
<div class="col-md-12 col-sm-12 col-xs-12">
<div class="em_about_us_content">
<?php echo $data_subtitle; ?>
<?php echo $data_title; ?>
<?php echo $data_desc; ?>
<div class="em_about_us_button">
<a href=""><i class="fa fa-android"></i> <span>available on<small><br> Google Store</span></a>
<a class="active-btn" href=""><i class="fa fa-apple"></i> <span>available on<small><br>Apple Store</span></a>
</div>
</div>
</div>
<?php }?>
</div>
<?php
return ob_get_clean();
}
add_shortcode('em_about_us' ,'em_about_us_shortcode');
}