This commit is contained in:
KhaiNguyen
2020-02-13 10:39:37 +07:00
commit 59401cb805
12867 changed files with 4646216 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,120 @@
<?php
/*
* Template: Sticky navbar sections - Side Gallery
*/
if(!function_exists('kd_section_set_side_gallery')) {
function kd_section_set_side_gallery($atts,$content = null){
// Declare empty vars
$output = $image = $images = $img = $thumbnail = $gal_images = $featured_gallery_id = $default_src = $dimensions = $hwstring = $animation_delay = $wrapper_class = '';
extract(shortcode_atts(array(
'gallery_image_source' => '',
'fss_photo_gallery' => '',
'gallery_ext_image' => '',
'gallery_ext_image_size' => '',
'fss_gallery_shadow' => '',
'fss_loop' => '',
'fss_autoplay' => '',
'fss_autoplay_speed' => '',
'fss_stoponhover' => '',
'css_animation_image' => '',
),$atts));
if ($gallery_image_source == 'external_link') {
$images = vc_value_from_safe( $gallery_ext_image );
$images = explode( ',', $images );
} else {
$images = explode( ',', $fss_photo_gallery );
}
if ( '' === $images ) {
$images = '-1,-2,-3';
}
$default_src = vc_asset_url( 'vc/no_image.png' );
foreach ( $images as $i => $image ) {
if ($gallery_image_source == 'external_link') {
if ($gallery_ext_image != '') {
$image = esc_attr( $image );
$dimensions = vc_extract_dimensions( $gallery_ext_image_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
$thumbnail = '<img ' . $hwstring . ' src="' . $image . '" />';
} else {
$thumbnail = '<img src="'.$default_src.'" class="vc_img-placeholder" />';
}
} else {
if ( $image > 0 ) {
$img = wpb_getImageBySize( $params = array(
'post_id' => NULL,
'attach_id' => $image,
'thumb_size' => 'full',
'class' = > 'ffs-gallery-img'
));
$thumbnail = $img['thumbnail'];
} else {
$thumbnail = '<img src="'.$default_src.'" class="vc_img-placeholder" />';
}
}
$gal_images .= $thumbnail;
}
$featured_gallery_id = "kd-featured-gallery-".uniqid();
$output .= '<script type="text/javascript">
jQuery(document).ready(function($){
if ($(".'.$featured_gallery_id.' .featured-gallery").length) {
$(".'.$featured_gallery_id.' .featured-gallery").owlCarousel({
stageClass: "owl-wrapper",
stageOuterClass: "owl-wrapper-outer",
loadedClass: "owl-carousel",
items: 1,
rewind: true,
dots: true,
nav: false,
dotsSpeed: 500,';
if($fss_loop == "loop_on") {
$output .= 'loop: true,';
}
if($fss_autoplay == "auto_on") {
$output .= 'autoplay: true,';
}
if($fss_autoplay_speed !== "") {
$output .= 'autoplayTimeout: '.$fss_autoplay_speed.',';
}
if($fss_autoplay == "auto_on" && $fss_stoponhover == "hover_on") {
$output .= 'autoplayHoverPause: true,';
}
$output .='
addClassActive: true,
});
}
});
</script>';
/* Animation delay */
if ('' !== $css_animation_image) {
$animation_delay = 'data-animation-delay="200"';
} else {
$animation_delay = '';
}
$wrapper_class = implode(' ', array('side-featured-wrapper', $featured_gallery_id, $css_animation_image, $css_animation_image, $fss_gallery_shadow));
$output .= '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>
<div class="featured-gallery">'.$gal_images.'</div>
</div>';
return $output;
}
}

View File

@@ -0,0 +1,95 @@
<?php
/*
* Template: Sticky navbar sections - Side Photo
*/
if(!function_exists('kd_section_set_side_photo')) {
// Declare empty vars
$image = $content_image = $default_src = $dimensions = $hwstring = $animation_delay = $wrapper_class = '';
function kd_section_set_side_photo($atts,$content = null){
extract(shortcode_atts(array(
'featured_image_source' => '',
'fss_featured_image' => '',
'featured_ext_image' => '',
'fss_image_style' => '',
'fss_image_shadow' => '',
'fss_click_action' => '',
'fss_image_link' => '',
'fss_link_target' => '',
'css_animation_image' => '',
),$atts));
$default_src = vc_asset_url( 'vc/no_image.png' );
$image = wpb_getImageBySize($params = array(
'post_id' => NULL,
'attach_id' => $fss_featured_image,
'thumb_size' => 'full',
'class' => ""
));
if ($featured_image_source == 'external_link') {
$src = $featured_ext_image;
} elseif ($featured_image_source == 'media_library' && !$image) {
$src = $default_src;
} else {
$link = wp_get_attachment_image_src( $fss_featured_image, 'large' );
$link = $link[0];
$src = $link;
}
if ($featured_image_source == 'external_link' && $featured_ext_image != '') {
list($width, $height) = getimagesize($src);
} else {
list($width, $height) = getimagesize($link);
}
$a_attrs['href'] = $fss_image_link;
$a_attrs['target'] = $fss_link_target;
if ($featured_image_source == 'external_link') {
if (!$featured_ext_image) {
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
if ($fss_click_action == 'open_photoswipe') {
$content_image = '<a data-size="' . $width. 'x' .$height .'" href='. $featured_ext_image . '><img src="'.$featured_ext_image.'" width="' . $width. '" height="' .$height .'" /></a>';
} elseif ($fss_click_action == 'custom_link') {
$content_image = '<a ' . vc_stringify_attributes( $a_attrs ) . '><img src="'.$featured_ext_image.'" width="' . $width. '" height="' .$height .'" /></a>';
} else {
$content_image ='<img src="'.$featured_ext_image.'" width="' . $width. '" height="' .$height .'" />';
}
}
} else {
if (!$fss_featured_image) {
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
if ($fss_click_action == 'open_photoswipe') {
$content_image = '<a data-size="' . $width. 'x' .$height .'" href='. $src . '>' . $image['thumbnail'] . '</a>';
} elseif ($fss_click_action == 'custom_link') {
$content_image = '<a ' . vc_stringify_attributes( $a_attrs ) . '>' . $image['thumbnail'] . '</a>';
} else {
$content_image = $image['thumbnail'];
}
}
}
/* Animation delay */
if ('' !== $css_animation_image) {
$animation_delay = 'data-animation-delay="200"';
} else {
$animation_delay = '';
}
$wrapper_class = implode(' ', array('side-featured-wrapper', $fss_image_style, $css_animation_image, $fss_image_shadow));
$output = '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>
<div class="featured-image">'.$content_image.'</div>
</div>';
return $output;
}
}

View File

@@ -0,0 +1,70 @@
<?php
/*
* Template: Sticky navbar sections - Side Video
*/
if(!function_exists('kd_section_set_side_video')) {
// Declare empty vars
$video_w = $video_h = $embed = $cover_image = $content_image = $dimensions = $hwstring = $default_src = $animation_delay = '';
function kd_section_set_side_video($atts,$content = null){
extract(shortcode_atts(array(
'fss_video_url' => '',
'video_image_source' => '',
'fss_video_cover' => '',
'video_ext_image' => '',
'video_ext_image_size' => '',
'fss_video_shadow' => '',
'fss_play_button' => '',
'css_animation_image' => '',
),$atts));
$default_src = vc_asset_url( 'vc/no_image.png' );
$dimensions = vc_extract_dimensions( $video_ext_image_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
if ($video_image_source == 'external_link') {
if (!$video_ext_image) {
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
$content_image ='<img src="'.$video_ext_image.'" '.$hwstring.' />';
}
} else {
if (!$fss_video_cover) {
$content_image ='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
$cover_image = wpb_getImageBySize ( $params = array( 'post_id' => NULL, 'attach_id' => $fss_video_cover, 'thumb_size' => 'full', 'class' => "" ) );
$content_image = $cover_image['thumbnail'];
}
}
$video_w = 500;
$video_h = $video_w / 1.61; //1.61 golden ratio
global $wp_embed;
if ( is_object( $wp_embed ) ) {
$embed = $wp_embed->run_shortcode( '[embed width="' . $video_w . '"' . $video_h . ']' . $fss_video_url . '[/embed]' );
}
/* Animation delay */
if ('' !== $css_animation_image) {
$animation_delay = 'data-animation-delay="200"';
} else {
$animation_delay = '';
}
$wrapper_class = implode(' ', array('side-featured-wrapper', $fss_video_shadow, $css_animation_image, ));
$output = '<div class="' . trim($wrapper_class) . '" ' . $animation_delay . '>
<div class="entry-video">
<div class="video-cover">
<div class="background-video-image">'.$content_image.'</div>
<div class="play-video kd-animate '.$fss_play_button.'"><span class="fa fa-play"></span></div>
'.$embed.'
</div>
</div>
</div>';
return $output;
}
}

View File

@@ -0,0 +1,2 @@
<?php
// Silence is golden.

View File

@@ -0,0 +1,127 @@
<?php
/*
* Template: Team Members Classic
*/
if(!function_exists('kd_team_set_classic')) {
function kd_team_set_classic($atts,$content = null){
extract(shortcode_atts(array(
'title' => '',
'title_color' => '',
'position' => '',
'position_color' => '',
'description' => '',
'description_color' => '',
'image_source' => '',
'image' => '',
'ext_image' => '',
'ext_image_size' => '',
'tm_phone' => '',
'tm_email' => '',
'team_bg_color' => '',
'facebook_url' => '',
'instagram_url' => '',
'twitter_url' => '',
'linkedin_url' => '',
'github_url' => '',
'social_color' => '',
'team_external_url' => '',
'team_link_text' => '',
'team_link_target' => '',
'css_animation' => '',
'elem_animation_delay' => '',
'team_extra_class' => '',
),$atts));
$animation_delay = $default_src = $dimensions = $hwstring = $a_attrs = '';
$image = wpb_getImageBySize($params = array(
'post_id' => NULL,
'attach_id' => $image,
'thumb_size' => 'full',
'class' => ""
));
$default_src = vc_asset_url( 'vc/no_image.png' );
$dimensions = vc_extract_dimensions( $ext_image_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
//CSS Animation
if ($css_animation == "no_animation") {
$css_animation = "";
}
// Animation delay
if ($elem_animation_delay) {
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
}
$output = '<div class="team-member design-classic '.$css_animation.' '.$team_extra_class.'" '.$animation_delay.'>
<div class="team-content">
<div class="team-image-overlay"></div>
<div class="team-image">';
if(isset($team_external_url) && $team_external_url !== '') {
$output .='<a href="'.$team_external_url.'" target="'.$team_link_target.'">';
}
if ($image_source == 'external_link') {
if (!$ext_image) {
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
$output .='<img src="'.$ext_image.'" '.$hwstring.' />';
}
} else {
if (!$image) {
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
$output .= $image['thumbnail'];
}
}
if(isset($team_external_url) && $team_external_url !== '') {
$output .='</a>';
}
$output .= '</div>
<div class="team-content-text" '.(!empty($team_bg_color) ? 'style="background-color: '.$team_bg_color.';"' : '').'>
<div class="team-content-text-inner">
<h5 '.(!empty($title_color) ? 'style="color: '.$title_color.';"' : '').'>'.$title.'</h5>
<span class="team-subtitle" '.(!empty($position_color) ? 'style="color: '.$position_color.';"' : '').'>'.$position.'</span>
<p '.(!empty($description_color) ? 'style="color: '.$description_color.';"' : '').'>'.$description.'</p>';
if ($team_external_url && $team_link_text) {
$output .= '<p class="team-link"><a href="'.$team_external_url.'" target="'.$team_link_target.'">'.$team_link_text.'</a></p>';
}
if ($tm_phone || $tm_email) {
$output .= '<div class="kd-team-contact">';
if ($tm_phone) {
$output .= '<div class="kd-team-phone"><a href="tel:'.$tm_phone.'">'.(!empty($tm_phone_label) ? '<span class="team-phone-label">'.$tm_phone_label.'</span>' : '').'<span class="fa fa-phone"></span>'.$tm_phone.'</a></div>';
}
if ($tm_email) {
$output .= '<div class="kd-team-email"><a href="mailto:'.$tm_email.'">'.(!empty($tm_email_label) ? '<span class="team-email-label">'.$tm_email_label.'</span>' : '').'<span class="fa fa-envelope"></span>'.$tm_email.'</a></div>';
}
$output .= '</div>';
}
$output .= '</div>
<div class="team-socials">';
if(isset($facebook_url) && $facebook_url !== '') {
$output .='<a href="'.$facebook_url.'" target="_blank"><span class="fa fa-facebook" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($instagram_url) && $instagram_url !== '') {
$output .='<a href="'.$instagram_url.'" target="_blank"><span class="fa fa-instagram" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($twitter_url) && $twitter_url !== '') {
$output .='<a href="'.$twitter_url.'" target="_blank"><span class="fa fa-twitter" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($linkedin_url) && $linkedin_url !== '') {
$output .='<a href="'.$linkedin_url.'" target="_blank"><span class="fa fa-linkedin" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($github_url) && $github_url !== '') {
$output .='<a href="'.$github_url.'" target="_blank"><span class="fa fa-github-alt" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
$output .='</div>
</div>
</div>
</div>';
return $output;
}
}

View File

@@ -0,0 +1,123 @@
<?php
/*
* Template: Team Members Creative
*/
if(!function_exists('kd_team_set_creative')) {
function kd_team_set_creative($atts,$content = null){
extract(shortcode_atts(array(
'title' => '',
'title_color' => '',
'position' => '',
'position_color' => '',
'image_source' => '',
'image' => '',
'ext_image' => '',
'ext_image_size' => '',
'tm_phone' => '',
'tm_email' => '',
'team_bg_color' => '',
'facebook_url' => '',
'instagram_url' => '',
'twitter_url' => '',
'linkedin_url' => '',
'github_url' => '',
'social_color' => '',
'team_external_url' => '',
'team_link_text' => '',
'team_link_target' => '',
'css_animation' => '',
'elem_animation_delay' => '',
'team_extra_class' => '',
),$atts));
$animation_delay = $default_src = $dimensions = $hwstring = $module_with_link = $wrapper_class = '';
$image = wpb_getImageBySize($params = array(
'post_id' => NULL,
'attach_id' => $image,
'thumb_size' => 'full',
'class' => ""
));
$default_src = vc_asset_url( 'vc/no_image.png' );
$dimensions = vc_extract_dimensions( $ext_image_size );
$hwstring = $dimensions ? image_hwstring( $dimensions[0], $dimensions[1] ) : '';
//CSS Animation
if ($css_animation == "no_animation") {
$css_animation = "";
}
// Animation delay
if ($elem_animation_delay) {
$animation_delay = 'data-animation-delay='.$elem_animation_delay;
}
// Link settings
if ($team_external_url) {
$module_with_link = 'team-with-link';
}
$wrapper_class = implode(' ', array('team-member', 'design-creative', $module_with_link, $css_animation, $team_extra_class));
$output = '<div class="'.trim($wrapper_class).'" '.$animation_delay.'>
<div class="team-content" '.(!empty($team_bg_color) ? 'style="background-color: '.$team_bg_color.';"' : '').'>
<div class="team-image">';
if ($image_source == 'external_link') {
if (!$ext_image) {
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
$output .='<img src="'.$ext_image.'" '.$hwstring.' />';
}
} else {
if (!$image) {
$output .='<img src="'.$default_src.'" class="vc_img-placeholder" />';
} else {
$output .= $image['thumbnail'];
}
}
$output .= '<div class="team-content-hover">
<h4 '.(!empty($title_color) ? 'style="color: '.$title_color.';"' : '').'>'.$title.'</h4>
<p class="team-subtitle" '.(!empty($position_color) ? 'style="color: '.$position_color.';"' : '').'>'.$position.'</p>';
if ($team_external_url && $team_link_text) {
$output .= '<p class="team-link"><a href="'.$team_external_url.'" target="'.$team_link_target.'">'.$team_link_text.'</a></p>';
}
if ($tm_phone || $tm_email) {
$output .= '<div class="kd-team-contact">';
if ($tm_phone) {
$output .= '<div class="kd-team-phone"><a href="tel:'.$tm_phone.'">'.(!empty($tm_phone_label) ? '<span class="team-phone-label">'.$tm_phone_label.'</span>' : '').'<span class="fa fa-phone"></span></a></div>';
}
if ($tm_email) {
$output .= '<div class="kd-team-email"><a href="mailto:'.$tm_email.'">'.(!empty($tm_email_label) ? '<span class="team-email-label">'.$tm_email_label.'</span>' : '').'<span class="fa fa-envelope"></span></a></div>';
}
$output .= '</div>';
}
$output .= '<div class="team-socials">';
if(isset($facebook_url) && $facebook_url !== '') {
$output .='<a href="'.$facebook_url.'" target="_blank"><span class="fa fa-facebook" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($instagram_url) && $instagram_url !== '') {
$output .='<a href="'.$instagram_url.'" target="_blank"><span class="fa fa-instagram" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($twitter_url) && $twitter_url !== '') {
$output .='<a href="'.$twitter_url.'" target="_blank"><span class="fa fa-twitter" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($linkedin_url) && $linkedin_url !== '') {
$output .='<a href="'.$linkedin_url.'" target="_blank"><span class="fa fa-linkedin" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
if(isset($github_url) && $github_url !== '') {
$output .='<a href="'.$github_url.'" target="_blank"><span class="fa fa-github-alt" '.(!empty($social_color) ? 'style="color: '.$social_color.';"' : '').'></span></a>';
}
$output .='</div>
</div></div>
</div>
</div>';
return $output;
}
}