File: //home/retoti4c1e1s/public_html/thecommitment.earth/wp-content/themes/ananke/shortcodes.php
<?php
/*Custom Heading*/
add_shortcode('heading','heading_func');
function heading_func($atts, $content = null){
extract(shortcode_atts(array(
'title' => '',
'class' => '',
'shadow_text' => ''
), $atts));
ob_start(); ?>
<div class="header-text <?php echo esc_attr($class); ?>">
<?php if(!empty($shadow_text)){ ?>
<div class="header-shadow-text">
<?php echo esc_attr($title); ?>
</div>
<?php } ?>
<h1><?php echo esc_attr($title); ?></h1>
<p><?php echo htmlspecialchars_decode($content); ?></p>
</div>
<?php
return ob_get_clean();
}
/*Home Slider Moving Background*/
add_shortcode('movingbg', 'movingbg_func');
function movingbg_func($atts, $content = null){
extract(shortcode_atts(array(
'poster' => '',
), $atts));
ob_start(); ?>
<div class="parallax-home" <?php if($poster != ''){ ?>style="background: url('<?php echo wp_get_attachment_image_url( $poster, 'full' ); ?>');"<?php } ?> ></div>
<div class="big-text flippy">
<?php echo htmlspecialchars_decode($content); ?>
</div>
<script type="text/javascript">
(function($) { "use strict";
var pos = 0;
window.setInterval(function(){
pos++;
document.getElementsByClassName('parallax-home')[0].style.backgroundPosition = pos + "px 0px";
}, 40);
})(jQuery);
</script>
<?php
return ob_get_clean();
}
/*Home Slider Pattern*/
add_shortcode('patternbg', 'patternbg_func');
function patternbg_func($atts, $content = null){
extract(shortcode_atts(array(
'poster' => '',
), $atts));
ob_start(); ?>
<div class="pattern-home" <?php if($poster != ''){ ?>style="background: url('<?php echo wp_get_attachment_image_url( $poster, 'full' ); ?>');"<?php } ?> ></div>
<div class="big-text flippy">
<?php echo htmlspecialchars_decode($content); ?>
</div>
<script type="text/javascript">
(function($) { "use strict";
var pos = 0;
window.setInterval(function(){
pos++;
document.getElementsByClassName('pattern-home')[0].style.backgroundPosition = pos + "px 0px";
}, 40);
})(jQuery);
</script>
<?php
return ob_get_clean();
}
/*Home Slider Video*/
add_shortcode('slidervideo', 'slidervideo_func');
function slidervideo_func($atts, $content = null){
extract(shortcode_atts(array(
'mp4' => '',
'webm' => '',
'ogg' => '',
'poster' => '',
'sound_video' => '',
'volume' => '',
), $atts));
$audiosound = '';
if ( ! empty( $sound_video ) ) {
$audiosound = 'volume="'.$volume.'"';
}else{
$audiosound = 'muted volume="0"';
}
ob_start(); ?>
<video id="video_background" preload="auto" autoplay loop <?php echo $audiosound; ?> poster="<?php echo wp_get_attachment_image_url( $poster, 'full' ); ?>" playsinline>
<?php if($webm!=''){ ?><source src="<?php echo esc_url($webm); ?>" type="video/webm"> <?php } ?>
<?php if($mp4!=''){ ?><source src="<?php echo esc_url($mp4); ?>" type="video/mp4"> <?php } ?>
<?php if($ogg!=''){ ?><source src="<?php echo esc_url($ogg); ?>" type="video/ogg"><?php } ?>
</video>
<div class="big-text flippy">
<?php echo htmlspecialchars_decode($content); ?>
</div>
<?php
return ob_get_clean();
}
/*Arrow Down Slider*/
add_shortcode('arrowdown', 'arrowdown_func');
function arrowdown_func($atts, $content = null){
extract(shortcode_atts(array(
'bg' => '',
'link' => '',
'btntext' => '',
), $atts));
$img = wp_get_attachment_image_url( $bg, 'full' );
$extra = '';
if ( $bg != '' ) { $extra = 'style="background-image: url('.$img.')"'; }
$html = '<a class="scroll" href="'.$link.'"><div '.$extra.' class="scroll-btn tipped" data-title="'.$btntext.'"></div></a>';
return $html;
}
/*Buttons Slider*/
add_shortcode('btnslider','btnslider_func');
function btnslider_func($atts, $content = null){
extract(shortcode_atts(array(
'text1' => '',
'text2' => '',
'link1' => '',
'link2' => '',
), $atts));
ob_start(); ?>
<div class="small-text">
<div class="cl-effect-5">
<?php if($text1) { ?><a class="scroll" href="<?php echo esc_url($link1); ?>"><span data-hover="<?php echo esc_attr($text1); ?>"><?php echo esc_attr($text1); ?></span></a><?php } ?>
<?php if($text2) { ?><a class="scroll" href="<?php echo esc_url($link2); ?>"><span data-hover="<?php echo esc_attr($text2); ?>"><?php echo esc_attr($text2); ?></span></a><?php } ?>
</div>
</div>
<?php
return ob_get_clean();
}
/*Socials Slider*/
add_shortcode('socslider','socslider_func');
function socslider_func($atts, $content = null){
extract(shortcode_atts(array(
'icon1' => '',
'icon2' => '',
'icon3' => '',
'icon4' => '',
'icon5' => '',
'link1' => '',
'link2' => '',
'link3' => '',
'link4' => '',
'link5' => '',
'target' => '',
), $atts));
ob_start(); ?>
<div class="social-top">
<ul class="list-social">
<?php if($icon1!='') { ?>
<li class="icon-soc tipped" data-title="<?php if($icon1 == 'google-plus') { echo "google +"; }else{ echo esc_attr($icon1); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<a target="<?php if($target == '_blank'){ echo '_blank'; }else{ echo '_self'; } ?>" href="<?php echo esc_url($link1); ?>"><i class="fa fa-<?php echo esc_attr($icon1); ?>"></i></a>
</li>
<?php } ?>
<?php if($icon2!='') { ?>
<li class="icon-soc tipped" data-title="<?php if($icon2 == 'google-plus') { echo "google +"; }else{ echo esc_attr($icon2); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<a target="<?php if($target == '_blank'){ echo '_blank'; }else{ echo '_self'; } ?>" href="<?php echo esc_url($link2); ?>"><i class="fa fa-<?php echo esc_attr($icon2); ?>"></i></a>
</li>
<?php } ?>
<?php if($icon3!='') { ?>
<li class="icon-soc tipped" data-title="<?php if($icon3 == 'google-plus') { echo "google +"; }else{ echo esc_attr($icon3); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<a target="<?php if($target == '_blank'){ echo '_blank'; }else{ echo '_self'; } ?>" href="<?php echo esc_url($link3); ?>"><i class="fa fa-<?php echo esc_attr($icon3); ?>"></i></a>
</li>
<?php } ?>
<?php if($icon4!='') { ?>
<li class="icon-soc tipped" data-title="<?php if($icon4 == 'google-plus') { echo "google +"; }else{ echo esc_attr($icon4); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<a target="<?php if($target == '_blank'){ echo '_blank'; }else{ echo '_self'; } ?>" href="<?php echo esc_url($link4); ?>"><i class="fa fa-<?php echo esc_attr($icon4); ?>"></i></a>
</li>
<?php } ?>
<?php if($icon5!='') { ?>
<li class="icon-soc tipped" data-title="<?php if($icon5 == 'google-plus') { echo "google +"; }else{ echo esc_attr($icon5); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<a target="<?php if($target == '_blank'){ echo '_blank'; }else{ echo '_self'; } ?>" href="<?php echo esc_url($link5); ?>"><i class="fa fa-<?php echo esc_attr($icon5); ?>"></i></a>
</li>
<?php } ?>
</ul>
</div>
<?php
return ob_get_clean();
}
/*About Box*/
add_shortcode('aboutbox', 'aboutbox_func');
function aboutbox_func($atts, $content = null){
extract(shortcode_atts(array(
'title' => '',
'icon' => '',
), $atts));
ob_start(); ?>
<div class="about-what-we-do" data-scrollreveal="enter bottom and move 150px over 1s">
<div class="icon-left1"><i class="fa fa-<?php echo esc_attr($icon); ?>"></i></div>
<h5><?php echo htmlspecialchars_decode($title); ?></h5>
<?php echo wpb_js_remove_wpautop($content, true); ?>
</div>
<?php
return ob_get_clean();
}
/*About Video*/
add_shortcode('aboutvideo', 'aboutvideo_func');
function aboutvideo_func($atts, $content = null){
extract(shortcode_atts(array(
'textover' => '',
'mp4' => '',
'webm' => '',
'ogg' => '',
'poster' => '',
'content1' => '',
'content2' => '',
'content3' => '',
'sound_video' => '',
'volume' => '',
'overlay_pattern' => ''
), $atts));
$audiosound = '';
if ( ! empty( $sound_video ) ) {
$audiosound = 'volume="'.$volume.'"';
} else {
$audiosound = 'muted volume="0"';
}
ob_start(); ?>
<div class="video-sections">
<div class="video-section-1" <?php if ( $poster != '' ) { ?>style="background: url('<?php echo wp_get_attachment_image_url( $poster, 'full' ); ?>');"<?php } ?> >
<?php if($webm != '' || $mp4 != '' || $ogg != '') { ?>
<video id="video_background" preload="auto" autoplay loop <?php echo $audiosound; ?> poster="<?php echo wp_get_attachment_image_url( $poster, 'full' ); ?>" playsinline>
<?php if($webm != ''){ ?><source src="<?php echo esc_url($webm); ?>" type="video/webm"><?php } ?>
<?php if($mp4 != ''){ ?><source src="<?php echo esc_url($mp4); ?>" type="video/mp4"><?php } ?>
<?php if($ogg != ''){ ?><source src="<?php echo esc_url($ogg); ?>" type="video/ogg"><?php } ?>
</video>
<?php } ?>
<?php if ( empty( $overlay_pattern ) ) { ?>
<div class="just_pattern"></div>
<?php } ?>
<div class="text-over-video"><?php echo htmlspecialchars_decode($textover); ?></div>
</div>
<div class="video-section-2">
<div class="container">
<div class="nine columns padding-top-video-sec2" data-scrollreveal="enter right and move 150px over 1s">
<?php echo htmlspecialchars_decode($content1); ?>
</div>
<div class="nine columns" data-scrollreveal="enter right and move 150px over 1s">
<?php echo htmlspecialchars_decode($content2); ?>
</div>
<div class="nine columns" data-scrollreveal="enter right and move 150px over 1s">
<?php echo htmlspecialchars_decode($content3); ?>
</div>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
/*Member Team*/
add_shortcode('memberItem','memberItem_func');
function memberItem_func($atts, $content = null){
extract(shortcode_atts(array(
'name' => '',
'job' => '',
'src' => '',
'icon1' => '',
'url1' => '',
'icon2' => '',
'url2' => '',
'icon3' => '',
'url3' => '',
'icon4' => '',
'url4' => '',
), $atts));
$icon11 = (!empty($icon1) ? '<a href="'.esc_url($url1).'" target="_blank"><i class="fa fa-'.esc_attr($icon1).'"></i></a>' : '');
$icon22 = (!empty($icon2) ? '<a href="'.esc_url($url2).'" target="_blank"><i class="fa fa-'.esc_attr($icon2).'"></i></a>' : '');
$icon33 = (!empty($icon3) ? '<a href="'.esc_url($url3).'" target="_blank"><i class="fa fa-'.esc_attr($icon3).'"></i></a>' : '');
$icon44 = (!empty($icon4) ? '<a href="'.esc_url($url4).'" target="_blank"><i class="fa fa-'.esc_attr($icon4).'"></i></a>' : '');
ob_start(); ?>
<div class="" data-scrollreveal="enter bottom and move 150px over 1s">
<div class="team-wrap">
<?php if ( $src != '' ) { echo wp_get_attachment_image( $src, array('600', '600'), "", array( "class" => "img-responsive" ) ); } ?>
<h5><?php echo htmlspecialchars_decode($name); ?></h5>
<p><?php echo htmlspecialchars_decode($job); ?></p>
<div class="team-line"></div>
<div class="team-desc"><?php echo htmlspecialchars_decode($content); ?></div>
<div class="social-team">
<ul class="team-social">
<?php if($icon1!='') { ?>
<li class="icon-team tipped" data-title="<?php if($icon1 == 'google-plus') { echo esc_attr( "google +" ); }else{ echo esc_attr($icon1); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<?php echo htmlspecialchars_decode($icon11); ?>
</li>
<?php } ?>
<?php if($icon2!='') { ?>
<li class="icon-team tipped" data-title="<?php if($icon2 == 'google-plus') { echo esc_attr( "google +" ); }else{ echo esc_attr($icon2); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<?php echo htmlspecialchars_decode($icon22); ?>
</li>
<?php } ?>
<?php if($icon3!='') { ?>
<li class="icon-team tipped" data-title="<?php if($icon3 == 'google-plus') { echo esc_attr( "google +" ); }else{ echo esc_attr($icon3); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<?php echo htmlspecialchars_decode($icon33); ?>
</li>
<?php } ?>
<?php if($icon4!='') { ?>
<li class="icon-team tipped" data-title="<?php if($icon4 == 'google-plus') { echo esc_attr( "google +" ); }else{ echo esc_attr($icon4); } ?>" data-tipper-options='{"direction":"top","follow":"true"}'>
<?php echo htmlspecialchars_decode($icon44); ?>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
<?php
return ob_get_clean();
}
/*Slide Show*/
add_shortcode('slideshow', 'slideshow_func');
function slideshow_func($atts, $content = null){
extract(shortcode_atts(array(
'title' => '',
'autoplay' => 'no',
'slider_time' => 10000,
), $atts));
$slider_time1 = (!empty($slider_time) ? $slider_time : 10000);
ob_start(); ?>
<div class="slideshow" id="slideshow">
<ol class="slides">
<?php
$args = array( 'post_type'=>'slide', 'posts_per_page'=> -1 );
$slide = new WP_Query( $args );
if ( $slide->have_posts() ): $i = 0;
while ( $slide->have_posts() ) : $slide->the_post();
$view = get_post_meta(get_the_ID(),'_cmb_tilt_view', true);
$link1 = get_post_meta(get_the_ID(),'_cmb_link_1', true);
$link2 = get_post_meta(get_the_ID(),'_cmb_link_2', true);
?>
<li class="<?php if ( $i==0 ) { echo 'current'; } ?>">
<div class="description">
<h4><?php the_title(); ?></h4>
<p><?php the_content(); ?></p>
</div>
<div class="tiltview <?php echo $view; ?>">
<?php
if ( function_exists( 'rwmb_meta' ) ) {
$images1 = rwmb_meta( '_cmb_image_1', array( 'size' => 'full' ) );
foreach ( $images1 as $image1 ) {
$get_image1 = '<img src="' . esc_url( $image1['url'] ) . '" alt="' . esc_attr( $image1['alt'] ) . '" />';
}
}
?>
<?php if ( $link1 != '' ) { ?>
<div><a href="<?php echo esc_url( $link1 ); ?>"><?php echo $get_image1; ?></a></div>
<?php } else { ?>
<div><?php echo $get_image1; ?></div>
<?php } ?>
<?php
if ( function_exists( 'rwmb_meta' ) ) {
$images2 = rwmb_meta( '_cmb_image_2', array( 'size' => 'full' ) );
foreach ( $images2 as $image2 ) {
$get_image2 = '<img src="' . esc_url( $image2['url'] ) . '" alt="' . esc_attr( $image2['alt'] ) . '" />';
}
}
?>
<?php if ( $link2 != '' ) { ?>
<div><a href="<?php echo esc_url( $link2 ); ?>"><?php echo $get_image2; ?></a></div>
<?php } else { ?>
<div><?php echo $get_image2; ?></div>
<?php } ?>
</div>
</li>
<?php $i++; endwhile; endif; ?>
</ol>
</div>
<script type="text/javascript">
window.jQuery = window.$ = jQuery;
(function($) { "use strict";
new TiltSlider( document.getElementById( 'slideshow' ) );
<?php if($autoplay == 'yes'){ ?>
//Adding autoplay + prev&next buttons to slider.
window.setInterval(function(){
$('nav>.current').next().trigger('click');
if($('nav > .current').next().index() == '-1'){
$('nav > span').trigger('click');
}
}, <?php echo esc_attr($slider_time1); ?>);
<?php } ?>
})(jQuery);
</script>
<?php
return ob_get_clean();
}
/*OT Portfolio*/
add_shortcode('portfolio','portfolio_func');
function portfolio_func($atts, $content = null){
extract( shortcode_atts( array(
'all' => '',
'order' => 'ASC',
'orderby' => 'date',
'show' => '',
'columns' => 4,
), $atts ) );
$all1 = (!empty($all) ? $all : 'Show All');
$order1 = (!empty($order) ? $order : 'ASC');
$orderby1 = (!empty($orderby) ? $orderby : 'date');
$show1 = (!empty($show) ? $show : 8);
ob_start(); ?>
<div class="clear"></div>
<div class="portfolio"></div>
<div class="expander-wrap relative">
<div id="expander-wrap">
<p class="cls-btn"><a class="close">X</a></p>
<div class="expander-inner"></div>
</div>
</div>
<div class="clear"></div>
<div class="container">
<div class="twelve columns">
<div id="portfolio-filter">
<ul id="filter">
<li><a href="#" class="current" data-filter="*" title=""><?php echo esc_attr($all1); ?></a></li>
<?php
$categories = get_terms('categories');
foreach( (array)$categories as $categorie){
$cat_name = $categorie->name;
$cat_slug = $categorie->slug;
?>
<li><a href="#" data-filter=".<?php echo esc_attr($cat_slug); ?>"><?php echo esc_attr($cat_name); ?></a></li>
<?php } ?>
</ul>
</div>
</div>
</div>
<ul class="portfolio-wrap pf_full_width <?php if ($columns == 2) { echo 'pf_2_cols'; }elseif ($columns == 3) { echo 'pf_3_cols'; }elseif ($columns == 6) { echo 'pf_6_cols'; }elseif ($columns == 5) { echo 'pf_5_cols'; }else{ echo 'pf_4_cols'; } ?>">
<?php
global $post;
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => $show1,
'order' => $order1,
'orderby' => $orderby1
);
$wp_query = new WP_Query($args);
while ($wp_query -> have_posts()) : $wp_query -> the_post();
$cates = get_the_terms( get_the_ID(), 'categories' );
$cate_name ='';
$cate_slug = '';
if ( ! is_wp_error( $cates ) && ! empty( $cates ) ) :
foreach ( $cates as $cate ) {
$cate_name .= $cate->name.' ' ;
$cate_slug .= $cate->slug.' ';
}
endif;
$format = get_post_format($post->ID);
$link_video = get_post_meta(get_the_ID(),'_cmb_portfolio_video', true);
$link_audio = get_post_meta(get_the_ID(),'_cmb_portfolio_audio', true);
?>
<li class="portfolio-box <?php echo esc_attr( $cate_slug ); ?>">
<a class="expander" href="<?php the_permalink(); ?>" title="">
<?php $params = array( 'width' => 600, 'height' => 375 );
$image = bfi_thumb( wp_get_attachment_url(get_post_thumbnail_id()), $params ); ?>
<img src="<?php echo esc_url($image); ?>" alt="" />
<div class="mask"></div>
<h4><?php the_title(); ?></h4>
</a>
<?php if ( $format=='video' ) { ?>
<a class="fancybox-media fancybox.iframe" href="<?php echo esc_url( $link_video ); ?>" title="">
<div class="fancybox-button"></div>
</a>
<?php } elseif ( $format=='audio' ) { ?>
<a class="fancybox-media fancybox.iframe" href="<?php echo esc_url( $link_audio ); ?>" title="">
<div class="fancybox-button"></div>
</a>
<?php } else { ?>
<a class="fancybox-effects-d" href="<?php echo esc_url(wp_get_attachment_url(get_post_thumbnail_id())); ?>" title="">
<div class="fancybox-button"></div>
</a>
<?php } ?>
</li>
<?php endwhile;?>
</ul>
<?php
return ob_get_clean();
}
/*OT Portfolio Category*/
add_shortcode('cate_portfolio','cate_portfolio_func');
function cate_portfolio_func($atts, $content = null){
extract( shortcode_atts( array(
'all' => '',
'order' => 'ASC',
'orderby' => 'date',
'show' => '',
'idcate' => '',
'cate_active' => '',
'columns' => 4,
), $atts ) );
$all1 = (!empty($all) ? $all : 'Show All');
$order1 = (!empty($order) ? $order : 'ASC');
$orderby1 = (!empty($orderby) ? $orderby : 'date');
$show1 = (!empty($show) ? $show : 8);
$portfolio_category_isotope = uniqid( 'portfolio-gallery-' );
$item_isotope = uniqid( 'item-' );
$filters_isotope = uniqid( 'filters-' );
$portfolio_section = uniqid( 'portfolio-' );
$expander_wrap = uniqid( 'expander-wrap-' );
$close_pfajax = uniqid( 'close-' );
$expander_pf = uniqid( 'expander-' );
$cate_active1 = (!empty($cate_active) ? '.'.$cate_active : '*');
ob_start(); ?>
<div class="clear"></div>
<div class="<?php echo esc_attr($portfolio_section); ?> portfolio-section"></div>
<div class="<?php echo esc_attr($expander_wrap); ?> expander-wrap-outer relative">
<div id="<?php echo esc_attr($expander_wrap); ?>" class="expander-wrap-section">
<p class="cls-btn"><a class="closef <?php echo esc_attr($close_pfajax); ?>">X</a></p>
<div class="expander-inner"></div>
</div>
</div>
<div class="clear"></div>
<div class="container">
<div class="twelve columns">
<div class="portfolio-filter">
<ul id="<?php echo esc_attr($filters_isotope); ?>" class="filter">
<?php if($all != ''){ ?><li><a href="#" data-filter="*" <?php if($cate_active == ''){echo 'class="current"';} ?>><?php echo esc_attr($all1); ?></a></li><?php } ?>
<?php
if ($idcate != '') {
$categories = explode(",",$idcate);
}else{
$categories = get_terms('categories');
}
foreach( (array)$categories as $categorie){
if ($idcate != '') {
$cates = get_term_by('slug', $categorie, 'categories');
$cat_name = $cates->name;
$cat_slug = $cates->slug;
}else{
$cat_name = $categorie->name;
$cat_slug = $categorie->slug;
}
?>
<li><a href="#" data-filter=".<?php echo wp_specialchars_decode( $cat_slug ); ?>" <?php if( $cate_active != '' && $cate_active == $cat_slug ){echo 'class="current"';} ?> ><?php echo wp_specialchars_decode( $cat_name ); ?></a></li>
<?php } ?>
</ul>
</div>
</div>
</div>
<ul id="<?php echo esc_attr($portfolio_category_isotope); ?>" class="portfolio-wrap pf_full_width <?php if ($columns == 2) { echo 'pf_2_cols'; }elseif ($columns == 3) { echo 'pf_3_cols'; }elseif ($columns == 6) { echo 'pf_6_cols'; }elseif ($columns == 5) { echo 'pf_5_cols'; }else{ echo 'pf_4_cols'; } ?>">
<?php
global $post;
if ($idcate != '') {
$args = array(
'tax_query' => array(
array(
'taxonomy' => 'categories',
'field' => 'slug',
'terms' => explode(',',$idcate)
),
),
'post_type' => 'portfolio',
'showposts' => $show1,
'order' => $order1,
'orderby' => $orderby1
);
}else{
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => $show1,
'order' => $order1,
'orderby' => $orderby1
);
}
$wp_query = new WP_Query($args);
while ($wp_query -> have_posts()) : $wp_query -> the_post();
$cates = get_the_terms( get_the_ID(), 'categories' );
$cate_name ='';
$cate_slug = '';
if ( ! is_wp_error( $cates ) && ! empty( $cates ) ) :
foreach ( $cates as $cate ) {
$cate_name .= $cate->name.' ' ;
$cate_slug .= $cate->slug.' ';
}
endif;
$format = get_post_format($post->ID);
$link_video = get_post_meta(get_the_ID(),'_cmb_portfolio_video', true);
?>
<li class="portfolio-box <?php echo esc_attr($cate_slug); ?>">
<a class="<?php echo esc_attr($expander_pf); ?>" href="<?php the_permalink(); ?>" title="">
<?php $params = array( 'width' => 600, 'height' => 375 );
$image = bfi_thumb( wp_get_attachment_url(get_post_thumbnail_id()), $params ); ?>
<img src="<?php echo esc_url($image); ?>" alt="" />
<div class="mask"></div>
<h4><?php the_title(); ?></h4>
</a>
<?php if($format=='video'){ ?>
<a class="fancybox-media fancybox.iframe" href="<?php echo esc_url( $link_video ); ?>" title="">
<div class="fancybox-button"></div>
</a>
<?php }else{ ?>
<a class="fancybox-effects-d" href="<?php echo esc_url(wp_get_attachment_url(get_post_thumbnail_id())); ?>" title="">
<div class="fancybox-button"></div>
</a>
<?php } ?>
</li>
<?php endwhile;?>
</ul>
<script type="text/javascript">
jQuery(document).ready(function() {
'use strict';
window.onresize = function(event) {
jQuery('#<?php echo esc_attr($portfolio_category_isotope); ?>').isotope();
};
jQuery(window).load(function() {
var $container = jQuery('#<?php echo esc_attr($portfolio_category_isotope); ?>');
$container.isotope({
itemSelector: '.<?php echo esc_attr($item_isotope); ?>',
filter: '<?php echo esc_attr($cate_active1); ?>'
});
jQuery('#<?php echo esc_attr($filters_isotope); ?> a').on("click", function() {
jQuery('#<?php echo esc_attr($filters_isotope); ?> a').removeClass('current');
jQuery(this).addClass('current');
var selector = jQuery(this).attr('data-filter');
$container.isotope({
filter: selector
});
return false;
});
jQuery('#<?php echo esc_attr($filters_isotope); ?> > li > a.current').click();
});
/*Portfolio Ajax*/
$(window).load(function() {'use strict';
var loader = $('.<?php echo esc_attr($expander_wrap); ?>');
if(typeof loader.html() == 'undefined'){
$('<div class="<?php echo esc_attr($expander_wrap); ?> expander-wrap-outer relative"><div id="<?php echo esc_attr($expander_wrap); ?>" class="container clearfix relative"><p class="cls-btn"><a class="closef <?php echo esc_attr($close_pfajax); ?>">X</a></p><div/></div></div>').css({opacity:0}).hide().insertAfter('.<?php echo esc_attr($portfolio_section); ?>');
loader = $('.<?php echo esc_attr($expander_wrap); ?>');
}
$('.<?php echo esc_attr($expander_pf); ?>').on('click', function(e){
e.preventDefault();
e.stopPropagation();
var url = $(this).attr('href');
loader.slideUp(function(){
$('.page-overlay').show();
$.get(url, function(data){
var portfolioContainer = $('.<?php echo esc_attr($portfolio_section); ?>');
var topPosition = portfolioContainer.offset().top;
var bottomPosition = topPosition + portfolioContainer.height();
$('html,body').delay(600).animate({ scrollTop: bottomPosition - -10}, 800);
var container = $('#<?php echo esc_attr($expander_wrap); ?>>div', loader);
container.html(data);
$(".video").fitVids();
$('.project').flexslider({
animation: "fade",
selector: ".project-slides .slide",
controlNav: false,
directionNav: true ,
slideshowSpeed: 5000,
});
loader.slideDown(function(){
$('.page-overlay').hide();
if(typeof keepVideoRatio == 'function'){
keepVideoRatio('.video > iframe');
}
}).delay(1000).animate({opacity:1}, 200);
});
});
});
$('.<?php echo esc_attr($close_pfajax); ?>', loader).on('click', function(){
loader.delay(300).slideUp(function(){
var container = $('#<?php echo esc_attr($expander_wrap); ?>>div', loader);
container.html('');
$(this).css({opacity:0});
});
var portfolioContainer = $('.<?php echo esc_attr($portfolio_section); ?>');
var topPosition = portfolioContainer.offset().top;
$('html,body').delay(0).animate({ scrollTop: topPosition - 70}, 500);
});
});
});
</script>
<?php
return ob_get_clean();
}
/*Slider Project (use)*/
add_shortcode('folioslider', 'folioslider_func');
function folioslider_func($atts, $content = null){
extract(shortcode_atts(array(
'gallery' => '',
), $atts));
ob_start(); ?>
<div class="project">
<ul class="project-slides">
<?php
$img_ids = explode(",",$gallery);
foreach( $img_ids AS $img_id ){
$meta = wp_prepare_attachment_for_js($img_id);
$caption = $meta['caption'];
$title = $meta['title'];
$description = $meta['description'];
$image_src = wp_get_attachment_image_src($img_id,'');
?>
<li class="slide"><img src="<?php echo esc_url($image_src[0]); ?>" alt=""></li>
<?php } ?>
</ul>
</div>
<?php
return ob_get_clean();
}
/*Video Player (use)*/
add_shortcode('videoplayer', 'videoplayer_func');
function videoplayer_func($atts, $content = null){
extract(shortcode_atts(array(
'video' => '',
'withvideo' => '',
'heightvideo'=> ''
), $atts));
$withvideo1 = (!empty($withvideo)) ? $withvideo : 950;
$heightvideo1 = (!empty($heightvideo)) ? $heightvideo : 400;
ob_start(); ?>
<div class="video">
<iframe src="<?php echo esc_url($video); ?>" width="<?php echo esc_attr($withvideo1); ?>" height="<?php echo esc_attr($heightvideo1); ?>" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" frameborder="0"></iframe>
</div>
<?php
return ob_get_clean();
}
/*Audio Player */
add_shortcode('audiopost', 'audiopost_func');
function audiopost_func($atts, $content = null){
extract(shortcode_atts(array(
'linkmp3' => '',
'linkoog' => '',
), $atts));
ob_start(); ?>
<div class="audio-player">
<audio controls>
<?php if($linkoog != ''){ ?><source src="<?php echo esc_url($linkoog); ?>" type="audio/ogg"> <?php } ?>
<?php if($linkmp3 != ''){ ?><source src="<?php echo esc_url($linkmp3); ?>" type="audio/mpeg"> <?php } ?>
</audio>
</div>
<?php
return ob_get_clean();
}
/*Call To Action*/
add_shortcode('callto', 'callto_func');
function callto_func($atts, $content = null){
extract(shortcode_atts(array(
'btnhover' => '',
'btntext' => '',
'link' => '',
), $atts));
ob_start(); ?>
<div class="link-work" data-scrollreveal="enter top and move 150px over 1s">
<h6><?php echo htmlspecialchars_decode($content); ?></h6>
<div class="cl-effect-5">
<a class="scroll" href="<?php echo esc_url($link); ?>">
<span data-hover="<?php echo esc_attr($btnhover); ?>"><?php echo esc_attr($btntext); ?></span>
</a>
</div>
</div>
<?php
return ob_get_clean();
}
/*Our Facts*/
add_shortcode('ourfacts', 'ourfacts_func');
function ourfacts_func($atts, $content = null){
extract(shortcode_atts(array(
'title' => '',
'number' => '',
), $atts));
ob_start(); ?>
<div class="facts-wrap">
<div class="facts-wrap-num"><span class="counter"><?php echo esc_attr($number); ?></span></div>
<h5><?php echo esc_attr($title); ?></h5>
</div>
<?php
return ob_get_clean();
}
/*Services Box*/
add_shortcode('servicebox', 'service_func');
function service_func($atts, $content = null){
extract(shortcode_atts(array(
'title' => '',
'icon' => '',
'icon_color' => '',
'icontype' => 'svgicons',
'iconawesome' => '',
'iconimage' => '',
'linkbox' => '',
'css' => '',
), $atts));
$url = vc_build_link( $linkbox );
$icon_color1 = (!empty($icon_color) ? 'style="color:'.esc_attr($icon_color).'"' : '');
$iconclass = '';
if ($icontype == 'fontawesome') {
$iconclass = 'service-icon-awesome';
}elseif($icontype == 'iconimg'){
$iconclass = 'service-icon-image';
}else{
$iconclass = 'service-icon-svg';
}
ob_start(); ?>
<div class="<?php echo vc_shortcode_custom_css_class( $css ); ?>">
<?php if ( strlen( $linkbox ) > 0 && strlen( $url['url'] ) > 0 ) {
echo '<a style="color:inherit;" href="' . esc_attr( $url['url'] ) . '" title="' . esc_attr( $url['title'] ) . '" target="' . ( strlen( $url['target'] ) > 0 ? esc_attr( $url['target'] ) : '_self' ) . '">';
} ?>
<div class="services-offer <?php echo esc_attr($iconclass); ?>">
<?php if ($icontype == 'fontawesome') { ?>
<i class="<?php echo esc_attr( $iconawesome ); ?>" aria-hidden="true" <?php echo $icon_color1; ?> ></i>
<?php }elseif($icontype == 'iconimg'){ ?>
<?php if ( $iconimage != '' ) { echo wp_get_attachment_image( $iconimage, "full", "", array( "class" => "img-responsive" ) ); } ?>
<?php }else{ ?>
<span class="svg-icon flat-filled" id="filled-<?php echo esc_attr($icon); ?>"></span>
<?php } ?>
<h5><?php echo htmlspecialchars_decode($title); ?></h5>
<p><?php echo htmlspecialchars_decode($content); ?></p>
</div>
<?php if ( strlen( $linkbox ) > 0 && strlen( $url['url'] ) > 0 ) {
echo '</a>';
} ?>
</div>
<?php
return ob_get_clean();
}
/*Pricing Table*/
add_shortcode('pricingtable', 'pricingtable_func');
function pricingtable_func($atts, $content = null){
extract(shortcode_atts(array(
'title' => '',
'price' => '',
'buttontext' => '',
'link' => '',
'featured' => 'no',
), $atts));
ob_start(); ?>
<div data-scrollreveal="enter bottom and move 150px over 1s">
<div class="plans-offer<?php if($featured == 'yes') { echo "-gold";}?>">
<h3><?php echo htmlspecialchars_decode($price); ?></h3>
<h6><?php echo esc_attr($title); ?></h6>
<?php echo htmlspecialchars_decode($content); ?>
<div class="cl-effect-5"><a class="scroll" href="<?php echo esc_url($link); ?>"><span data-hover="<?php echo esc_attr($buttontext); ?>"><?php echo esc_attr($buttontext); ?></span></a></div>
</div>
</div>
<?php
return ob_get_clean();
}
/*Logo Clients*/
add_shortcode('clients','clients_func');
function clients_func($atts, $content = null){
extract(shortcode_atts(array(
'src' => '',
'link' => '',
), $atts));
ob_start(); ?>
<div class="logos-wrap">
<?php if($link != '') { ?>
<a target="_blank" href="<?php echo esc_url($link); ?>">
<?php if($src != ''){ echo wp_get_attachment_image( $src, 'full', '', array( "class" => "img-responsive" ) ); } ?>
</a>
<?php }else{ ?>
<?php if($src != ''){ echo wp_get_attachment_image( $src, 'full', '', array( "class" => "img-responsive" ) ); } ?>
<?php } ?>
</div>
<?php
return ob_get_clean();
}
/*End Clients Logo*/
/*Blog Post*/
add_shortcode('blog', 'blog_func');
function blog_func($atts, $content = null) {
extract(shortcode_atts(array(
'btntext' => '',
'link' => '',
'lenght' => '',
), $atts));
$lenght = ((!empty($lenght)) ? $lenght : '13');
ob_start(); ?>
<div class="z-index">
<?php
$args=array('post_type'=>'post','posts_per_page'=> 3);
$blog= new WP_Query($args);
if($blog->have_posts()):
while($blog->have_posts()) : $blog->the_post();
?>
<div class="four columns">
<div class="blog-post home-blog">
<?php $params = array( 'width' => 420, 'height' => 201 );
$image = bfi_thumb( wp_get_attachment_url(get_post_thumbnail_id()), $params ); ?>
<a href="<?php the_permalink(); ?>"><img src="<?php echo esc_url($image); ?>" alt="" /></a>
<h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<p><?php echo ananke_blog_excerpt($lenght); ?></p>
<p><span><?php the_date(get_option( 'date_format' )); ?></span><span><?php comments_number( __('0 comment', 'anake' ), __('1 comment', 'ananke' ), __('% comments', 'ananke' )); ?></span></p>
</div>
</div>
<?php endwhile; endif; ?>
<?php if($link != '' || $btntext != ''){ ?>
<div class="clear"></div>
<div class="twelve columns">
<div class="blog-link"><a href="<?php echo esc_url($link); ?>"><?php echo esc_attr($btntext); ?></a></div>
</div>
<?php } ?>
</div>
<?php
return ob_get_clean();
}
/*Contact Info*/
add_shortcode('cinfo','cinfo_func');
function cinfo_func($atts, $content = null){
extract(shortcode_atts(array(
'icon' => '',
'title' => '',
'desc' => '',
), $atts));
ob_start(); ?>
<div class="contact-wrap">
<p><i class="fa fa-<?php echo esc_attr($icon); ?>"></i><span><?php echo htmlspecialchars_decode($title); ?></span> <?php echo htmlspecialchars_decode($desc); ?></p>
</div>
<?php
return ob_get_clean();
}
/*Contact Info 2*/
add_shortcode('cinfo2','cinfo2_func');
function cinfo2_func($atts, $content = null){
extract(shortcode_atts(array(
'icon_fontawesome' => '',
'title' => '',
), $atts));
ob_start(); ?>
<div class="contact-det">
<h6><i class="<?php echo esc_attr($icon_fontawesome); ?>"></i><?php echo htmlspecialchars_decode($title); ?></h6>
<p><?php echo htmlspecialchars_decode($content); ?></p>
</div>
<?php
return ob_get_clean();
}
add_shortcode('maps','maps_func');
function maps_func($atts, $content = null){
extract(shortcode_atts(array(
'btntext' => '',
'imgmap' => '',
'tooltip' => '',
'latitude' => '',
'longitude' => '',
'zoommap' => 14,
'showgmap' => 'optionmap1',
), $atts));
$btntext1 = (!empty($btntext) ? $btntext : 'Locate Us on Map');
$tooltip1 = (!empty($tooltip) ? $tooltip : 'Ananke');
$latitude1 = (!empty($latitude) ? $latitude : 44.789511);
$longitude1 = (!empty($longitude) ? $longitude : 20.43633);
$zoommap1 = (!empty($zoommap) ? $zoommap : 14);
ob_start(); ?>
<?php if($showgmap != 'optionmap2'){ ?>
<div class="container">
<div class="twelve columns" data-scrollreveal="enter bottom and move 150px over 1s">
<a class="button-map close-map"><span><?php echo esc_attr($btntext1) ?></span></a>
</div>
</div>
<?php }?>
<div id="google_map" <?php if($showgmap == 'optionmap2'){ ?>class="show" <?php } ?> ></div>
<script type="text/javascript">
(function($) { "use strict"
var e=new google.maps.LatLng(<?php echo esc_attr($latitude1); ?>,<?php echo esc_attr($longitude1); ?>),
o={zoom:<?php echo esc_attr($zoommap1); ?>,center:new google.maps.LatLng(<?php echo esc_attr($latitude1); ?>,<?php echo esc_attr($longitude1); ?>),
mapTypeId:google.maps.MapTypeId.ROADMAP,
mapTypeControl:!1,
scrollwheel:!1,
draggable:!0,
navigationControl:!1
},
n=new google.maps.Map(document.getElementById("google_map"),o);
google.maps.event.addDomListener(window,"resize",function(){var e=n.getCenter();
google.maps.event.trigger(n,"resize"),n.setCenter(e)});
var g='<div class="map-tooltip"><h6><?php echo htmlspecialchars_decode($tooltip1); ?></h6></div>',a=new google.maps.InfoWindow({content:g})
,t=new google.maps.MarkerImage("<?php if ( $imgmap != '' ) { echo wp_get_attachment_image_url( $imgmap, 'full' ); } ?>",new google.maps.Size(40,70),
new google.maps.Point(0,0),new google.maps.Point(20,55)),
i=new google.maps.LatLng(<?php echo esc_attr($latitude1); ?>,<?php echo esc_attr($longitude1); ?>),
p=new google.maps.Marker({position:i,map:n,icon:t,zIndex:3});
google.maps.event.addListener(p,"click",function(){a.open(n,p)});
<?php if($showgmap != 'optionmap2'){ ?>
$(".button-map").click(function(){$("#google_map").slideToggle(300,function(){google.maps.event.trigger(n,"resize"),n.setCenter(e)}),
$(this).toggleClass("close-map show-map")});
<?php } ?>
})(jQuery);
</script>
<?php
return ob_get_clean();
}
/*Gmap Style 2*/
add_shortcode('maps2','maps2_func');
function maps2_func($atts, $content = null){
extract(shortcode_atts(array(
'iconmap' => '',
'address' => '',
'latitude' => '',
'longitude' => '',
'zoommap' => '',
'style' => 'default',
'gmap_custom_style' => '',
), $atts));
$id_map1 = uniqid( 'google-container' );
$gmap_custom_style1 = rawurldecode( base64_decode( strip_tags( $gmap_custom_style ) ) );
ob_start(); ?>
<div id="cd-google-map">
<div id="<?php echo esc_attr( $id_map1 ); ?>" style="position: relative;width: 100%;height: 500px;"></div>
<div id="cd-zoom-in"></div>
<div id="cd-zoom-out"></div>
<?php if($address != ''){ ?> <address><?php echo htmlspecialchars_decode($address); ?></address> <?php } ?>
</div>
<script type="text/javascript">
(function($) { "use strict"
/*set your google maps parameters*/
jQuery(document).ready(function($){
var latitude = <?php echo esc_attr($latitude); ?>,
longitude = <?php echo esc_attr($longitude); ?>,
map_zoom = <?php echo esc_attr($zoommap); ?>;
/*google map custom marker icon - .png fallback for IE11*/
var is_internetExplorer11= navigator.userAgent.toLowerCase().indexOf('trident') > -1;
var marker_url = ( is_internetExplorer11 ) ? '<?php if ( $iconmap != '' ) { echo wp_get_attachment_image_url( $iconmap, 'full' ); } ?>' : '<?php echo get_template_directory_uri(); ?>/images/cd-icon-location.svg';
/*we define here the style of the map*/
var style = <?php
if ( $style == 'default' ) {
echo '[
{
"featureType": "water",
"elementType": "geometry",
"stylers": [
{
"color": "#cccccc"
},
{
"lightness": 17
}
]
},
{
"featureType": "landscape",
"elementType": "geometry",
"stylers": [
{
"color": "#f5f5f5"
},
{
"lightness": 20
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#ffffff"
},
{
"lightness": 17
}
]
},
{
"featureType": "road.highway",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#ffffff"
},
{
"lightness": 29
},
{
"weight": 0.2
}
]
},
{
"featureType": "road.arterial",
"elementType": "geometry",
"stylers": [
{
"color": "#ffffff"
},
{
"lightness": 18
}
]
},
{
"featureType": "road.local",
"elementType": "geometry",
"stylers": [
{
"color": "#ffffff"
},
{
"lightness": 16
}
]
},
{
"featureType": "poi",
"elementType": "geometry",
"stylers": [
{
"color": "#f5f5f5"
},
{
"lightness": 21
}
]
},
{
"featureType": "poi.park",
"elementType": "geometry",
"stylers": [
{
"color": "#dedede"
},
{
"lightness": 21
}
]
},
{
"elementType": "labels.text.stroke",
"stylers": [
{
"visibility": "on"
},
{
"color": "#ffffff"
},
{
"lightness": 16
}
]
},
{
"elementType": "labels.text.fill",
"stylers": [
{
"saturation": 36
},
{
"color": "#333333"
},
{
"lightness": 40
}
]
},
{
"elementType": "labels.icon",
"stylers": [
{
"visibility": "off"
}
]
},
{
"featureType": "transit",
"elementType": "geometry",
"stylers": [
{
"color": "#f2f2f2"
},
{
"lightness": 19
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.fill",
"stylers": [
{
"color": "#fefefe"
},
{
"lightness": 20
}
]
},
{
"featureType": "administrative",
"elementType": "geometry.stroke",
"stylers": [
{
"color": "#fefefe"
},
{
"lightness": 17
},
{
"weight": 1.2
}
]
}
]';
} else {
echo $gmap_custom_style1;
} ?>;
//set google map options
var map_options = {
center: new google.maps.LatLng(latitude, longitude),
zoom: map_zoom,
panControl: false,
zoomControl: false,
mapTypeControl: false,
streetViewControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: false,
styles: style,
}
//inizialize the map
var map = new google.maps.Map(document.getElementById('<?php echo esc_attr( $id_map1 ); ?>'), map_options);
//add a custom marker to the map
var marker = new google.maps.Marker({
position: new google.maps.LatLng(latitude, longitude),
map: map,
visible: true,
icon: marker_url,
});
//add custom buttons for the zoom-in/zoom-out on the map
function CustomZoomControl(controlDiv, map) {
//grap the zoom elements from the DOM and insert them in the map
var controlUIzoomIn= document.getElementById('cd-zoom-in'),
controlUIzoomOut= document.getElementById('cd-zoom-out');
controlDiv.appendChild(controlUIzoomIn);
controlDiv.appendChild(controlUIzoomOut);
// Setup the click event listeners and zoom-in or out according to the clicked element
google.maps.event.addDomListener(controlUIzoomIn, 'click', function() {
map.setZoom(map.getZoom()+1)
});
google.maps.event.addDomListener(controlUIzoomOut, 'click', function() {
map.setZoom(map.getZoom()-1)
});
}
var zoomControlDiv = document.createElement('div');
var zoomControl = new CustomZoomControl(zoomControlDiv, map);
//insert the zoom div on the top left of the map
map.controls[google.maps.ControlPosition.LEFT_TOP].push(zoomControlDiv);
});
})(jQuery);
</script>
<?php
return ob_get_clean();
}
?>