'; $output .= do_shortcode($content); $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column One Fifth [one_fifth] [/one_fifth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_one_fifth' ) ) { function sc_one_fifth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column One Fourth [one_fourth] [/one_fourth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_one_fourth' ) ) { function sc_one_fourth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column One Third [one_third] [/one_third] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_one_third' ) ) { function sc_one_third( $attr, $content = null ) { $output = ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column Two Fifth [two_fifth] [/two_fifth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_two_fifth' ) ) { function sc_two_fifth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column One Second [one_second] [/one_second] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_one_second' ) ) { function sc_one_second( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column Two Fifth [three_fifth] [/three_fifth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_three_fifth' ) ) { function sc_three_fifth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column Two Third [two_third] [/two_third] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_two_third' ) ) { function sc_two_third( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column Three Fourth [three_fourth] [/three_fourth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_three_fourth' ) ) { function sc_three_fourth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column Two Fifth [four_fifth] [/four_fifth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_four_fifth' ) ) { function sc_four_fifth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column Two Fifth [five_sixth] [/five_sixth] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_five_sixth' ) ) { function sc_five_sixth( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Column One [one] [/one] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_one' ) ) { function sc_one( $attr, $content = null ) { $output = '
'; $output .= do_shortcode($content); $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Code [code] [/code] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_code' ) ) { function sc_code( $attr, $content = null ) { $output = '
';
			$output .= do_shortcode(htmlspecialchars($content));
		$output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Article Box [article_box] [/article_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_article_box' ) ) { function sc_article_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'slogan' => '', 'title' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $link ) $output .= ''; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; $output .= '
'; if( $slogan ) $output .= '

'. $slogan .'

'; if( $title ) $output .= '

'. $title .'

'; $output .= ''; $output .= '
'; if( $link ) $output .= '
'; if( $animate ) $output .= '
'."\n"; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Helper [helper] [/helper] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_helper' ) ) { function sc_helper( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'title_tag' => 'h4', 'title1' => '', 'content1' => '', 'link1' => '', 'target1' => '', 'class1' => '', 'title2' => '', 'content2' => '', 'link2' => '', 'target2' => '', 'class2' => '', ), $attr)); // target $target1 = $target1 ? 'target="_blank"' : false; $target2 = $target2 ? 'target="_blank"' : false; $output = '
'; $output .= '
'; if( $title ){ $output .= '<'. $title_tag .' class="title">'. $title .''; } $output .= ''; $output .= '
'; $output .= '
'; if( ! $link1 ) $output .= '
'. do_shortcode( $content1 ) .'
'; if( ! $link2 ) $output .= '
'. do_shortcode( $content2 ) .'
'; $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Before After [before_after] [/before_after] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_before_after' ) ) { function sc_before_after( $attr, $content = null ) { extract(shortcode_atts(array( 'image_before' => '', 'image_after' => '', 'classes' => '', ), $attr)); // image | visual composer fix $image_before = mfn_vc_image( $image_before ); $image_after = mfn_vc_image( $image_after ); $output = '
'; $output .= ''. mfn_get_attachment_data( $image_before, 'alt' ) .''; $output .= ''. mfn_get_attachment_data( $image_after, 'alt' ) .''; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Flat Box [flat_box] [/flat_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_flat_box' ) ) { function sc_flat_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'icon' => 'icon-lamp', 'icon_image' => '', 'background' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); $icon_image = mfn_vc_image( $icon_image ); // background if( $background ) $background = 'style="background-color:'. $background .'"'; // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $link ) $output .= ''; $output .= '
'; $output .= '
'; if( $icon_image ){ $output .= ''. mfn_get_attachment_data( $icon_image, 'alt' ) .''; } else { $output .= ''; } $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; if( $content )$output .= '
'. do_shortcode($content) .'
'; $output .= '
'; if( $link ) $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Flat Box [feature_box] [/feature_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_feature_box' ) ) { function sc_feature_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'background' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // background if( $background ) $background = 'style="background-color:'. $background .'"'; // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; $output .= '
'; $output .= '
'; if( $link ) $output .= ''; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; if( $link ) $output .= ''; $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; if( $content )$output .= '
'. do_shortcode($content) .'
'; $output .= '
'; $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Photo Box [photo_box] [/photo_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_photo_box' ) ) { function sc_photo_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'align' => '', 'link' => '', 'target' => '', 'greyscale' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } // class $class = ''; if( $align ) $class .= ' pb_'. $align; if( $greyscale ) $class .= ' greyscale'; if( !$content ) $class .= ' without-desc'; $output = '
'; if( $animate ) $output .= '
'; if( $title ) $output .= '

'. $title .'

'; if( $image ){ $output .= '
'; $output .= '
'; if( $link ) $output .= '';; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; if( $link ) $output .= '
'; $output .= '
'; $output .= '
'; } if( $content ) $output .= '
'. do_shortcode($content) .'
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Zoom Box [zoom_box] [/zoom_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_zoom_box' ) ) { function sc_zoom_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'bg_color' => '#000', 'content_image' => '', 'link' => '', 'target' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); $content_image = mfn_vc_image( $content_image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $link ) $output .= ''; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; $output .= '
'; $output .= '
'; if( $content_image ){ $output .= '
'; $output .= ''. mfn_get_attachment_data( $content_image, 'alt' ) .''; $output .= '
'; } if( $content ){ $output .= '
'; $output .= do_shortcode( $content ); $output .= '
'; } $output .= '
'; $output .= '
'; if( $link ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Sliding Box [sliding_box] [/sliding_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_sliding_box' ) ) { function sc_sliding_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $link ) $output .= ''; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; if( $link ) $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Story Box [story_box] [/story_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_story_box' ) ) { function sc_story_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'style' => '', 'title' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $link ) $output .= ''; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; $output .= '
'; if( $title ){ $output .= '

'. $title .'

'; $output .= '
'; } $output .= '
'. do_shortcode( $content ) .'
'; $output .= '
'; if( $link ) $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Trailer Box [trailer_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_trailer_box' ) ) { function sc_trailer_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'slogan' => '', 'title' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $link ) $output .= ''; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; if( $slogan ) $output .= '
'. $slogan .'
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= '
'; if( $link ) $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Promo Box [promo_box] [/promo_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_promo_box' ) ) { function sc_promo_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'btn_text' => '', 'btn_link' => '', 'position' => 'left', 'border' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // border if( $border ){ $border = 'has_border'; } else { $border = 'no_border'; } // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; $output .= '
'; $output .= '
'; if( $image ) $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; $output .= '
'; if( $title )$output .= '

'. $title .'

'; if( $content ) $output .= '
'. do_shortcode($content) .'
'; if( $btn_link ) $output .= ''. $btn_text .''; $output .= '
'; $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Share Box [share_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_share_box' ) ) { function sc_share_box( $attr, $content = null ) { $output = '
'; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= '
'; return $output; } } /* --------------------------------------------------------------------------- * How It Works [how_it_works] [/how_it_works] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_how_it_works' ) ) { function sc_how_it_works( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'number' => '', 'title' => '', 'border' => '', 'style' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // border if( $border ){ $border = 'has_border'; } else { $border = 'no_border'; } // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $link ) $output .= ''; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; if( $number ) $output .= ''. $number .''; $output .= '
'; if( $link ) $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'. do_shortcode($content) .'
'; if( $animate ) $output .= '
'."\n"; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Blog [blog] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_blog' ) ) { function sc_blog( $attr, $content = null ) { extract(shortcode_atts(array( 'count' => 2, 'style' => 'classic', 'columns' => 3, 'images' => '', 'category' => '', 'category_multi' => '', 'exclude_id' => '', 'filters' => '', 'more' => '', 'pagination' => '', 'load_more' => '', 'greyscale' => '', 'margin' => '', 'events' => '', ), $attr)); $translate['filter'] = mfn_opts_get('translate') ? mfn_opts_get('translate-filter','Filter by') : __('Filter by','betheme'); $translate['tags'] = mfn_opts_get('translate') ? mfn_opts_get('translate-tags','Tags') : __('Tags','betheme'); $translate['authors'] = mfn_opts_get('translate') ? mfn_opts_get('translate-authors','Authors') : __('Authors','betheme'); $translate['all'] = mfn_opts_get('translate') ? mfn_opts_get('translate-item-all','All') : __('All','betheme'); $translate['categories'] = mfn_opts_get('translate') ? mfn_opts_get('translate-categories','Categories') : __('Categories','betheme'); $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : ( ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1 ); $args = array( 'posts_per_page' => intval($count), 'paged' => $paged, 'post_status' => 'publish', 'ignore_sticky_posts' => 0, ); // private if( is_user_logged_in() ){ $args['post_status'] = array( 'publish', 'private' ); } // Include events | The events calendar if( $events ){ $args['post_type'] = array( 'post', 'tribe_events' ); } // categories if( $category_multi ){ $args['category_name'] = trim( $category_multi ); } elseif( $category ){ $args['category_name'] = $category; } // exclude posts if( $exclude_id ){ $exclude_id = str_replace( ' ', '', $exclude_id ); $args['post__not_in'] = explode( ',', $exclude_id ); } $query_blog = new WP_Query( $args ); // classes $classes = $style; if( $greyscale ) $classes .= ' greyscale'; if( $margin ) $classes .= ' margin'; if( ! $more ) $classes .= ' hide-more'; if( in_array( $style, array('masonry','masonry tiles') ) ){ $classes .= ' isotope'; } $output = '
'; // Echo | Filters if( $filters && in_array( $style, array('masonry','masonry tiles') ) && ! $category && ! $category_multi ){ $filters_class = ''; if( $filters != 1 ){ $filters_class .= ' only '. $filters; } $output .= '
'; $output .= ''; $output .= '
'; // categories $output .= ''; // tags $output .= ''; // authors $output .= ''; $output .= '
'; $output .= '
'."\n"; } // Echo | Main Content $output .= '
'; $output .= '
'; $images_only = false; if( $load_more || $images ){ $images_only = 'images_only'; } $output .= mfn_content_post( $query_blog, $style ,$images_only ); $output .= '
'; if( $pagination ) $output .= mfn_pagination( $query_blog, $load_more ); $output .= '
'."\n"; $output .= '
'."\n"; wp_reset_postdata(); return $output; } } /* --------------------------------------------------------------------------- * Blog Slider [blog_slider] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_blog_slider' ) ) { function sc_blog_slider( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'count' => 5, 'category' => '', 'category_multi' => '', 'more' => '', 'style' => '', 'navigation' => '', ), $attr)); $translate['readmore'] = mfn_opts_get('translate') ? mfn_opts_get('translate-readmore','Read more') : __('Read more','betheme'); // classes $classes = ''; if( ! $more ) $classes .= ' hide-more'; if( $style ) $classes .= ' '. $style; if( $navigation ) $classes .= ' '. $navigation; $args = array( 'posts_per_page' => intval($count), 'no_found_rows' => 1, 'post_status' => 'publish', 'ignore_sticky_posts' => 0, ); // private if( is_user_logged_in() ){ $args['post_status'] = array('publish','private'); } // categories if( $category_multi ){ $args['category_name'] = trim( $category_multi ); } elseif( $category ){ $args['category_name'] = $category; } $query_blog = new WP_Query( $args ); $output = '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'."\n"; wp_reset_postdata(); return $output; } } /* --------------------------------------------------------------------------- * Blog News [blog_news] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_blog_news' ) ) { function sc_blog_news( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'count' => 5, 'style' => '', 'category' => '', 'category_multi' => '', 'excerpt' => '', 'link' => '', 'link_title' => '', ), $attr)); $args = array( 'posts_per_page' => intval($count), 'no_found_rows' => 1, 'post_status' => 'publish', 'ignore_sticky_posts' => 0, ); // private if( is_user_logged_in() ){ $args['post_status'] = array('publish','private'); } // categories if( $category_multi ){ $args['category_name'] = trim( $category_multi ); } elseif( $category ){ $args['category_name'] = $category; } // featured first if( $style == 'featured' ){ $first = true; } else { $first = false; } $query_blog = new WP_Query( $args ); $output = '
'; if( $title ) $output .= '

'. $title .'

'; $output .= ''; $output .= ''; if( $link ) $output .= ''. $link_title .''; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Blog Teaser [blog_teaser] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_blog_teaser' ) ) { function sc_blog_teaser( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'title_tag' => 'h3', 'category' => '', 'category_multi' => '', // 'link' => '', // 'link_title' => '', 'margin' => '', ), $attr)); $args = array( 'posts_per_page' => 3, 'no_found_rows' => 1, 'post_status' => 'publish', 'ignore_sticky_posts' => 0, ); $translate['published'] = mfn_opts_get('translate') ? mfn_opts_get('translate-published','Published by') : __('Published by','betheme'); $translate['at'] = mfn_opts_get('translate') ? mfn_opts_get('translate-at','at') : __('at','betheme'); // title tag $title_tag = intval( str_replace( 'h', '', trim( $title_tag ) ) ); // class $class = ''; if( ! $margin ){ $class .= 'margin-no'; } // private if( is_user_logged_in() ){ $args['post_status'] = array('publish','private'); } // categories if( $category_multi ){ $args['category_name'] = trim( $category_multi ); } elseif( $category ){ $args['category_name'] = $category; } $query_blog = new WP_Query( $args ); $output = '
'; if( $title ) $output .= '

'. $title .'

'; $output .= ''; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Shop Slider [shop_slider] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_shop_slider' ) ) { function sc_shop_slider( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'count' => 5, 'show' => '', 'category' => '', 'orderby' => 'date', 'order' => 'DESC', ), $attr)); $args = array( 'post_type' => 'product', 'posts_per_page' => intval( $count ), 'paged' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1 ); // show if( $show == 'featured' ){ // featured ------------------------------ $args['meta_key'] = '_featured'; $args['meta_value'] = 'yes'; } elseif( $show == 'onsale' ){ // onsale -------------------------------- /* $args['meta_query'] = array( array( 'key' => '_sale_price', 'value' => 0, 'compare' => '>', 'type' => 'numeric' ), ); */ $args['post__in'] = array_merge( array( 0 ), wc_get_product_ids_on_sale() ); } elseif( $show == 'best-selling' ){ // best-selling -------------------------- $args['meta_key'] = 'total_sales'; $args['orderby'] = 'meta_value_num'; } // category if( $category ) $args['product_cat'] = $category; $query_shop = new WP_Query(); $query_shop->query( $args ); $output = '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'."\n"; wp_reset_postdata(); return $output; } } /* --------------------------------------------------------------------------- * Contact Box [contact_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_contact_box' ) ) { function sc_contact_box( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'address' => '', 'telephone' => '', 'telephone_2' => '', 'fax' => '', 'email' => '', 'www' => '', 'image' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // background if( $image ) $image = 'style="background-image:url('. $image .');"'; $output = ''; if( $animate ) $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= '
    '; if( $address ){ $output .= '
  • '; $output .= ''; $output .= ''. $address .''; $output .= '
  • '; } if( $telephone ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $telephone .'

    '; $output .= '
  • '; } if( $telephone_2 ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $telephone_2 .'

    '; $output .= '
  • '; } if( $fax ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $fax .'

    '; $output .= '
  • '; } if( $email ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $email .'

    '; $output .= '
  • '; } if( $www ){ if( strpos( $www, 'http' ) === 0 ){ $url = $www; $www = str_replace( 'http://', '', $www ); $www = str_replace( 'https://', '', $www ); } else { $url = 'http'. mfn_ssl() .'://'. $www; } $output .= '
  • '; $output .= ''; $output .= '

    '. $www .'

    '; $output .= '
  • '; } $output .= '
'; $output .= '
'; $output .= '
'."\n"; if( $animate ) $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Popup [popup][/popup] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_popup' ) ) { function sc_popup( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'padding' => '', 'button' => '', 'uid' => 'popup-'. uniqid(), ), $attr)); // padding if( $padding ){ $padding = 'style="padding:'. $padding .'px;"'; } else { $padding = false; } $output = ''; if( $button ){ $output .= ''. $title .''; } else { $output .= ''. $title .''; } $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Info Box [info_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_info_box' ) ) { function sc_info_box( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'image' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // background if( $image ) $image = 'style="background-image:url('. $image .');"'; $output = ''; if( $animate ) $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= do_shortcode($content); $output .= '
'; $output .= '
'."\n"; if( $animate ) $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Opening hours [opening_hours] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_opening_hours' ) ) { function sc_opening_hours( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'image' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // background if( $image ) $image = 'style="background-image:url('. $image .');"'; $output = ''; if( $animate ) $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= do_shortcode($content); $output .= '
'; $output .= '
'."\n"; if( $animate ) $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Divider [divider] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_divider' ) ) { function sc_divider( $attr, $content = null ) { extract(shortcode_atts(array( 'height' => 0, 'style' => '', // default, dots, zigzag 'line' => '', // default, narrow, wide, 0 = no_line 'themecolor' => '', ), $attr)); // classes $class = ''; if( $themecolor ) $class .= ' hr_color'; // height if( $height ){ $inlinecss = 'style="margin: 0 auto '. intval( $height ) .'px;"'; } else { $inlinecss = ''; } switch( $style ){ case 'dots': $output = '
'."\n"; break; case 'zigzag': $output = '
'."\n"; break; default: if( $line == 'narrow' ){ $output = '
'."\n"; } elseif( $line == 'wide' ) { $output = '

'."\n"; } elseif( $line ) { $output = '
'."\n"; } else { $output = '
'."\n"; } } return $output; } } /* --------------------------------------------------------------------------- * Fancy Divider [fancy_divider] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_fancy_divider' ) ) { function sc_fancy_divider( $attr, $content = null ) { extract(shortcode_atts(array( 'style' => 'stamp', 'color_top' => '', 'color_bottom' => '', ), $attr)); $output = '
'; switch( $style ){ case 'circle up': $output .= ''; $output .= ''; $output .= ''; break; case 'circle down': $output .= ''; $output .= ''; $output .= ''; break; case 'curve up': $output .= ''; $output .= ''; $output .= ''; break; case 'curve down': $output .= ''; $output .= ''; $output .= ''; break; case 'triangle up': $output .= ''; $output .= ''; $output .= ''; break; case 'triangle down': $output .= ''; $output .= ''; $output .= ''; break; default: $output .= ''; $output .= ''; $output .= ''; } $output .= '
'; return $output; } } /* --------------------------------------------------------------------------- * Google Font [google_font] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_google_font' ) ) { function sc_google_font( $attr, $content = null ) { extract(shortcode_atts(array( 'font' => '', 'size' => '25', 'weight' => '400', 'italic' => '', 'letter_spacing' => '', 'color' => '', 'subset' => '', ), $attr)); // style $style = array(); $style[] = "font-family:'". $font ."',Arial,Tahoma,sans-serif;"; $style[] = "font-size:". $size ."px;"; $style[] = "line-height:". $size ."px;"; $style[] = "font-weight:". $weight .";"; $style[] = "letter-spacing:". $letter_spacing ."px;"; if( $color ) $style[] = "color:". $color .";"; // italic if( $italic ){ $style[] = "font-style:italic;"; $weight = $weight .'italic'; } $style = implode( '', $style ); // subset if( $subset ){ $subset = '&subset='. str_replace( ' ', '', $subset ); } else { $subset = false; } // slug $font_slug = str_replace( ' ', '+', $font ); wp_enqueue_style( $font_slug, 'http'. mfn_ssl() .'://fonts.googleapis.com/css?family='. $font_slug .':'. $weight . $subset ); // $output = ''."\n"; $output = '
'. do_shortcode( $content ) .'
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Sidebar Widget [sidebar_widget] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_sidebar_widget' ) ) { function sc_sidebar_widget( $attr, $content = null ) { extract(shortcode_atts(array( 'sidebar' => '', ), $attr)); $output = ''; if( $sidebar !== '' && $sidebar !== false ){ $sidebars = mfn_opts_get( 'sidebars' ); $sidebar = $sidebars[$sidebar]; ob_start(); dynamic_sidebar( $sidebar ); $output = ob_get_clean(); } return $output; } } /* --------------------------------------------------------------------------- * Pricing Item [pricing_item] [/pricing_item] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_pricing_item' ) ) { function sc_pricing_item( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'currency' => '', 'currency_pos' => '', 'price' => '', 'period' => '', 'subtitle' => '', 'link_title' => '', 'link' => '', 'target' => '', 'icon' => '', 'featured' => '', 'style' => 'box', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } // classes $classes = ''; if( $currency_pos ) $classes .= ' cp-'. $currency_pos; if( $featured ) $classes .= ' pricing-box-featured'; if( $style ) $classes .= ' pricing-box-'. $style; $output = '
'; if( $animate ) $output .= '
'; $output .= '
'; if( $image ){ $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; } if( $title ) $output .= '

'. $title .'

'; if( $price ){ $output .= '
'; if( $currency_pos != 'right' ) $output .= ''. $currency .''; $output .= ''. $price .''; if( $currency_pos == 'right' ) $output .= ''. $currency .''; $output .= ''. $period .''; $output .= '
'; $output .= '
'; } if( $subtitle ) $output .= '

'. $subtitle .'

'; $output .= '
'; if( $content ){ $output .= '
'; $output .= do_shortcode($content); $output .= '
'; } if( $link ){ // button icon if( $icon ){ $icon = ''; $icon_class = 'button_left'; } else { $icon = false; $icon_class = false; } $output .= ''; } if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Call to Action [call_to_action] [/call_to_action] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_call_to_action' ) ) { function sc_call_to_action( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'icon' => '', 'link' => '', 'button_title' => '', 'class' => '', 'target' => '', 'animate' => '', ), $attr)); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } // FIX | prettyphoto if( strpos( $class, 'prettyphoto' ) !== false ){ $class = str_replace( 'prettyphoto', '', $class ); $rel = 'rel="prettyphoto"'; } else { $rel = false; } $output = '
'; if( $animate ) $output .= '
'; $output .= '
'; $output .= '
'; $output .= '

'. $title .'

'; $output .= '
'; $output .= '
'; if( $button_title ){ // Button if( $link ) $output .= ''; if( $icon ) $output .= ''; $output .= ''. $button_title .''; if( $link ) $output .= ''; } else { // Big Icon Link if( $link ) $output .= ''; $output .= ''; if( $link ) $output .= ''; } $output .= '
'; $output .= '
'; $output .= '
'. do_shortcode($content) .'
'; $output .= '
'; $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Chart [chart] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_chart' ) ) { function sc_chart( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'percent' => '', 'label' => '', 'icon' => '', 'image' => '', 'line_width' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // color if( $_GET && key_exists( 'mfn-c', $_GET ) ){ $color = '#D69942'; } else { $color = mfn_opts_get( 'color-counter', '#2991D6' ); } // line width if( $line_width ) $line_width = 'data-line-width="'. intval( $line_width ) .'"'; $output = '
'; $output .= '
'; if( $image ){ $output .= '
'. mfn_get_attachment_data( $image, 'alt' ) .'
'; } elseif( $icon ){ $output .= '
'; } else { $output .= '
'. $label .'
'; } $output .= '
'; $output .= '

'. $title .'

'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Countdown [countdown] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_countdown' ) ) { function sc_countdown( $attr, $content = null ) { extract(shortcode_atts(array( 'date' => '12/30/2016 12:00:00', 'timezone' => '0', ), $attr)); $translate['days'] = mfn_opts_get('translate') ? mfn_opts_get('translate-days','days') : __('days','betheme'); $translate['hours'] = mfn_opts_get('translate') ? mfn_opts_get('translate-hours','hours') : __('hours','betheme'); $translate['minutes'] = mfn_opts_get('translate') ? mfn_opts_get('translate-minutes','minutes') : __('minutes','betheme'); $translate['seconds'] = mfn_opts_get('translate') ? mfn_opts_get('translate-seconds','seconds') : __('seconds','betheme'); $output = '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
00
'; $output .= '
'; $output .= '

'. $translate['days'] .'

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
00
'; $output .= '
'; $output .= '

'. $translate['hours'] .'

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
00
'; $output .= '
'; $output .= '

'. $translate['minutes'] .'

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
00
'; $output .= '
'; $output .= '

'. $translate['seconds'] .'

'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Counter [counter] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_counter' ) ) { function sc_counter( $attr, $content = null ) { extract(shortcode_atts(array( 'icon' => '', 'color' => '', 'image' => '', 'number' => '', 'prefix' => '', 'label' => '', 'title' => '', 'type' => 'vertical', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // color if( $color ){ $color = 'style="color:'. $color .';"'; } else { $color = false; } $animate_math = mfn_opts_get('math-animations-disable') ? false : 'animate-math'; $output = '
'; if( $animate ) $output .= '
'; $output .= '
'; if( $image ){ $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; } elseif( $icon ){ $output .= ''; } $output .= '
'; $output .= '
'; if( $number ){ $output .= '
'; if( $prefix ) $output .= ''. $prefix .''; $output .= ''. $number .''; if( $label ) $output .= ''. $label .''; $output .= '
'; } if( $title ) $output .= '

'. $title .'

'; $output .= '
'; if( $animate ) $output .= '
'."\n"; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Icon [icon] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_icon' ) ) { function sc_icon( $attr, $content = null ) { extract(shortcode_atts(array( 'type' => '', ), $attr)); $output = ''; return $output; } } /* --------------------------------------------------------------------------- * Icon Block [icon_block] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_icon_block' ) ) { function sc_icon_block( $attr, $content = null ) { extract(shortcode_atts(array( 'icon' => '', 'align' => '', 'color' => '', 'size' => 25, ), $attr)); // classes $class = ''; if( $align ) $class .= ' icon_'. $align; if( $color ){ $color = ' color:'. $color .';'; } else { $class .= ' themecolor'; } $output = ''; $output .= ''; $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Image [image] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_image' ) ) { function sc_image( $attr, $content = null ) { extract(shortcode_atts(array( 'src' => '', 'width' => '', 'height' => '', 'border' => '', 'alt' => '', 'caption' => '', 'margin' => '', 'margin_top' => '', // alias for: margin 'margin_bottom' => '', 'align' => 'none', 'stretch' => '', 'link' => '', 'link_image' => '', 'target' => '', 'hover' => '', 'greyscale' => '', 'animate' => '', ), $attr)); // margin if( $margin_top ) $margin = $margin_top; if( $margin || $margin_bottom ){ $margin_tmp = ''; if( $margin ) $margin_tmp .= 'margin-top:'. intval( $margin ) .'px;'; if( $margin_bottom ) $margin_tmp .= 'margin-bottom:'. intval( $margin_bottom ) .'px;'; $margin = 'style="'. $margin_tmp .'"'; } else { $margin = false; } // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } // double link if( $link & $link_image ){ $double_link = 'double'; } else { $double_link = false; } // DIV image_frame | classes ---------------------- $class_div = ''; // align if( $align ) $class_div .= ' align'. $align; // stretch if( $stretch == 'ultrawide' ){ $class_div .= ' stretch-ultrawide'; } elseif( $stretch ){ $class_div .= ' stretch'; } // border if( $border ){ $class_div .= ' has_border'; } else { $class_div .= ' no_border'; } // greyscale if( $greyscale ) $class_div .= ' greyscale'; // hover if( $hover ) $class_div .= ' hover-disable'; // width x height, alt ---------------------------- // deprecated since 13.1 if( $width ) $class_div .= ' inline-block'; if( ! $width ) $width = mfn_get_attachment_data( $src, 'width' ); if( ! $height ) $height = mfn_get_attachment_data( $src, 'height' ); if( $width ) $width = 'width="'. $width .'"'; if( $height ) $height = 'height="'. $height .'"'; if( ! $alt ) $alt = mfn_get_attachment_data( $src, 'alt' ); // prettyPhoto ------------------------------------ // link_all $link_all = $link; if( $link_all ){ $rel = false; } else { $link_all = $link_image; $rel = 'rel="prettyphoto"'; $target = false; } $output = ''; if( $animate ) $output .= '
'; if( $link || $link_image ) { $output .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= ''. $alt .''; $output .= '
'; $output .= ''; $output .= '
'; if( $caption ) $output .= '

'. $caption .'

'; $output .= '
'."\n"; } else { $output .= ''."\n"; } if( $animate ) $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Hover Box [hover_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_hover_box' ) ) { function sc_hover_box( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'image_hover' => '', 'link' => '', 'target' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); $image_hover = mfn_vc_image( $image_hover ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $link ) $output .= ''; $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= ''. mfn_get_attachment_data( $image_hover, 'alt' ) .''; $output .= '
'; if( $link ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Hover Color [hover_color] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_hover_color' ) ) { function sc_hover_color( $attr, $content = null ) { extract(shortcode_atts(array( 'background' => '', 'background_hover' => '', 'border' => '', 'border_hover' => '', 'border_width' => '', 'padding' => '', 'link' => '', 'class' => '', 'target' => '', 'style' => '', ), $attr)); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } // padding if( $padding ){ $padding = 'style="padding:'. $padding .';"'; } else { $padding = false; } // FIX | prettyphoto if( strpos( $class, 'prettyphoto' ) !== false ){ $class = str_replace( 'prettyphoto', '', $class ); $rel = 'rel="prettyphoto"'; } else { $rel = false; } $output = '
'; $output .= '
'; if( $link ) $output .= ''; $output .= '
'; $output .= do_shortcode($content); $output .= '
'; if( $link ) $output .= '
'; $output .= '
'."\n"; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Quick Fact [quick_fact] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_quick_fact' ) ) { function sc_quick_fact( $attr, $content = null ) { extract(shortcode_atts(array( 'heading' => '', 'title' => '', 'number' => '', 'prefix' => '', 'label' => '', 'align' => 'center', 'animate' => '', ), $attr)); $animate_math = mfn_opts_get('math-animations-disable') ? false : 'animate-math'; $output = '
'; if( $animate ) $output .= '
'; if( $heading ) $output .= '

'. $heading .'

'; if( $number ){ $output .= '
'; if( $prefix ) $output .= ''. $prefix .''; $output .= ''. $number .''; if( $label ) $output .= ''. $label .''; $output .= '
'; } if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= '
'. do_shortcode($content) .'
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Button [button] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_button' ) ) { function sc_button( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => 'Button', 'link' => '', 'target' => '', 'align' => '', 'icon' => '', 'icon_position' => 'left', 'color' => '', 'font_color' => '', 'large' => '', // deprecated since Be 12.4 'size' => 2, 'full_width' => '', 'class' => '', 'rel' => '', 'download' => '', 'onclick' => '', ), $attr)); // target if( $target == 'lightbox' ){ $target = false; $rel = 'prettyphoto '. $rel; // do not change order } elseif( $target ){ $target = 'target="_blank"'; } // download if( $download ){ $download = 'download="'. $download .'"'; } // onclick if( $onclick ){ $onclick = 'onclick="'. $onclick .'"'; } // icon_position if( $icon_position != 'left' ){ $icon_position = 'right'; } // FIX | prettyphoto if( strpos( $class, 'prettyphoto' ) !== false ){ $class = str_replace( 'prettyphoto', '', $class ); $rel = 'prettyphoto '. $rel; } // class if( $icon ) $class .= ' button_'. $icon_position; if( $full_width ) $class .= ' button_full_width'; if( $large ){ $class .= ' button_large'; } else { if( $size ) $class .= ' button_size_'. $size; } // custom color $style = ''; $style_icon = ''; if( $color ){ if( strpos($color, '#') === 0 ){ if( mfn_opts_get('button-style') == 'stroke' ){ // Stroke | Border $style .= ' border-color:'. $color .' !important;'; $class .= ' button_stroke_custom'; } else { // Default | Background $style .= ' background-color:'. $color .' !important;'; } } else { $class .= ' button_'. $color; } } if( $font_color ){ $style .= ' color:'. $font_color .';'; $style_icon .= ' color:'. $font_color .' !important;'; } if( $style ){ $style = ' style="'. $style .'"'; } if( $style_icon ){ $style_icon = ' style="'. $style_icon .'"'; } // rel (do not move up) if( $rel ){ $rel = 'rel="'. esc_attr( $rel ) .'"'; } // link attributes $attributes = $target .' '. $rel .' '. $download .' '. $onclick .' '. $style; $output = ''; if( $align ) $output .= '
'; $output .= ''; if( $icon ) $output .= ''; if( $title ) $output .= ''. $title .''; $output .= ''; if( $align ) $output .= '
'; $output .= "\n"; return $output; } } /* --------------------------------------------------------------------------- * Icon Bar [icon_bar] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_icon_bar' ) ) { function sc_icon_bar( $attr, $content = null ) { extract(shortcode_atts(array( 'icon' => 'icon-lamp', 'link' => '', 'target' => '', 'size' => '', 'social' => '', ), $attr)); // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } // class $class = ''; if( $social ) $class .= ' icon_bar_'. $social; if( $size ) $class .= ' icon_bar_'. $size; $output = ''; $output .= ''; $output .= ''; $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Alert [alert] [/alert] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_alert' ) ) { function sc_alert( $attr, $content = null ) { extract(shortcode_atts(array( 'style' => 'warning', ), $attr)); switch( $style ){ case 'error': $icon = 'icon-alert'; break; case 'info': $icon = 'icon-help'; break; case 'success': $icon = 'icon-check'; break; default: $icon = 'icon-lamp'; break; } $output = '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; $output .= do_shortcode( $content ); $output .= '
'; $output .= ''; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Idea [idea] [/idea] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_idea' ) ) { function sc_idea( $attr, $content = null ) { $output = '
'; $output .= '
'; $output .= '
'. do_shortcode( $content ) .'
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Dropcap [dropcap] [/dropcap] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_dropcap' ) ) { function sc_dropcap( $attr, $content = null ) { extract(shortcode_atts(array( 'font' => '', 'size' => 1, // 1-3, or custom size in px 'background' => '', 'color' => '', 'circle' => '', 'transparent' => '', ), $attr)); $class = ''; $style = ''; // font family if( $font ){ $style .= "font-family:'". $font ."',Arial,Tahoma,sans-serif;"; $font_slug = str_replace( ' ', '+', $font ); wp_enqueue_style( $font_slug, 'http'. mfn_ssl() .'://fonts.googleapis.com/css?family='. $font_slug ); } // circle if( $circle ) $class = ' dropcap_circle'; // transparent if( $transparent ) $class = ' transparent'; // background if( $background ) $style .= 'background-color:'. $background .';'; // color if( $color ) $style .= ' color:'. $color .';'; // size $size = intval( $size ); $sizeH = $size + 15; if( $size > 3 ){ if( $transparent ){ $style .= ' font-size:'. $size .'px;height:'. $size .'px;line-height:'. $size .'px;width:'. $size .'px;'; } else { $style .= ' font-size:'. $size .'px;height:'. $sizeH .'px;line-height:'. $sizeH .'px;width:'. $sizeH .'px;'; } } else { $class .= ' size-'. $size; } if( $style ) $style = 'style="'. $style .'"'; $output = ''; $output .= do_shortcode( $content ); $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Highlight [highlight] [/highlight] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_highlight' ) ) { function sc_highlight( $attr, $content = null ) { extract(shortcode_atts(array( 'background' => '', 'color' => '', ), $attr)); // style $style = ''; if( $background ) $style .= 'background-color:'. $background .';'; if( $color ) $style .= ' color:'. $color .';'; if( $style ) $style = 'style="'. $style .'"'; $output = ''; $output .= do_shortcode($content); $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Tooltip [tooltip] [/tooltip] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_tooltip' ) ) { function sc_tooltip( $attr, $content = null ) { extract(shortcode_atts(array( 'hint' => '', ), $attr)); $output = ''; if( $hint ){ $output .= ''; $output .= do_shortcode( $content ); $output .= ''."\n"; } return $output; } } /* --------------------------------------------------------------------------- * Tooltip [tooltip_image] [/tooltip_image] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_tooltip_image' ) ) { function sc_tooltip_image( $attr, $content = null ) { extract(shortcode_atts(array( 'hint' => '', 'image' => '', ), $attr)); $output = ''; if( $hint || $image ){ $output .= ''; $output .= ''; if( $image ) $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; if( $hint ) $output .= $hint; $output .= ''; $output .= do_shortcode( $content ); $output .= ''."\n"; } return $output; } } /* --------------------------------------------------------------------------- * Content Link [content_link] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_content_link' ) ) { function sc_content_link( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'icon' => '', 'link' => '', 'target' => '', 'class' => '', 'download' => '', ), $attr)); // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } // download if( $download ){ $download = 'download="'. $download .'"'; } else { $download = false; } $output = ''; if( $icon ) $output .= ''; if( $title ) $output .= ''. $title .''; $output .= ''; return $output; } } /* --------------------------------------------------------------------------- * Fancy Link [fancy_link] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_fancy_link' ) ) { function sc_fancy_link( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'link' => '', 'target' => '', 'style' => '1', // 1-8 'class' => '', 'download' => '', ), $attr)); // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } // download if( $download ){ $download = 'download="'. $download .'"'; } else { $download = false; } $output = ''; $output .= ''. $title .''; $output .= ''; return $output; } } /* --------------------------------------------------------------------------- * Blockquote [blockquote] [/blockquote] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_blockquote' ) ) { function sc_blockquote( $attr, $content = null ) { extract(shortcode_atts(array( 'author' => '', 'link' => '', 'target' => '', ), $attr)); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; $output .= '
'. do_shortcode( $content ) .'
'; if( $author ){ $output .= '

'; $output .= ''; if( $link ){ $output .= ''. $author .''; } else { $output .= ''. $author .''; } $output .= '

'; } $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Clients [clients] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_clients' ) ) { function sc_clients( $attr, $content = null ) { extract(shortcode_atts(array( 'in_row' => 6, 'category' => '', 'orderby' => 'menu_order', 'order' => 'ASC', 'style' => '', 'greyscale' => '', ), $attr)); // class $class = ''; if( $greyscale ) $class .= ' greyscale'; if( $style ) $class .= ' clients_tiles'; if( ! intval( $in_row ) ) $in_row = 6; $args = array( 'post_type' => 'client', 'posts_per_page' => -1, 'orderby' => $orderby, 'order' => $order, ); if( $category ) $args['client-types'] = $category; $clients_query = new WP_Query(); $clients_query->query( $args ); $output = ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Clients slider [clients_slider] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_clients_slider' ) ) { function sc_clients_slider( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'category' => '', 'orderby' => 'menu_order', 'order' => 'ASC', ), $attr)); $args = array( 'post_type' => 'client', 'posts_per_page' => -1, 'orderby' => $orderby, 'order' => $order, ); if( $category ) $args['client-types'] = $category; $clients_query = new WP_Query(); $clients_query->query( $args ); if ($clients_query->have_posts()) { $output = '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= ''; $output .= '
'."\n"; } wp_reset_query(); $output .= ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Fancy Heading [fancy_heading] [/fancy_heading] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_fancy_heading' ) ) { function sc_fancy_heading( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'h1' => '', 'icon' => '', 'slogan' => '', 'style' => 'icon', // icon, line, arrows 'animate' => '', ), $attr)); $output = '
'; if( $animate ) $output .= '
'; if( $style == 'icon' && $icon ) $output .= ''; if( $style == 'line' && $slogan ) $output .= ''. $slogan .''; if( $style =='arrows' ) $title = ''. $title .''; if( $title ){ if( $h1 ){ $output .= '

'. $title .'

'; } else { $output .= '

'. $title .'

'; } } if( $content ) $output .= '
'. do_shortcode( $content ) .'
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Heading [heading] [/heading] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_heading' ) ) { function sc_heading( $attr, $content = null ) { extract(shortcode_atts(array( 'tag' => 'h2', 'align' => 'left', 'color' => '', 'style' => '', // [none], lines 'color2' => '', ), $attr)); $before = $after = ''; // inline_css $inline_css = ''; if( $color ){ $inline_css .= 'color:'. esc_attr( $color ) .';'; } if( $inline_css ){ $inline_css = 'style="'. $inline_css .'"'; } // inline_css2 $inline_css2 = ''; if( $color2 ){ $inline_css2 .= 'background:'. esc_attr( $color2 ) .';'; } if( $inline_css2 ){ $inline_css2 = 'style="'. $inline_css2 .'"'; } // style if( $style == 'lines' ){ $before = ''; $after = ''; } if( $style ){ $style = 'heading_'. $style; } // output $output = '
'; $output .= '<'. esc_attr( $tag ) .' class="title" '. $inline_css .'>'; $output .= $before; $output .= do_shortcode( $content ); $output .= $after; $output .= ''; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Icon Box [icon_box] [/icon_box] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_icon_box' ) ) { function sc_icon_box( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'title_tag' => 'h4', 'icon' => '', 'image' => '', 'icon_position' => 'top', 'border' => '', 'link' => '', 'target' => '', 'class' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // border if( $border ){ $border = 'has_border'; } else { $border = 'no_border'; } // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } // FIX | prettyphoto if( strpos( $class, 'prettyphoto' ) !== false ){ $class = str_replace( 'prettyphoto', '', $class ); $rel = 'rel="prettyphoto"'; } else { $rel = false; } $output = ''; if( $animate ) $output .= '
'; $output .= '
'; if( $link ) $output .= ''; if( $image ){ $output .= '
'; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
'; } else { $output .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; } $output .= '
'; if( $title ){ $output .= '<'. $title_tag .' class="title">'. $title .''; } if( $content )$output .= '
'. do_shortcode($content) .'
'; $output .= '
'; if( $link ) $output .= '
'; $output .= '
'."\n"; if( $animate ) $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Our Team [our_team] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_our_team' ) ) { function sc_our_team( $attr, $content = null ) { extract(shortcode_atts(array( 'heading' => '', 'image' => '', 'title' => '', 'subtitle' => '', 'phone' => '', 'email' => '', 'facebook' => '', 'twitter' => '', 'linkedin' => '', 'vcard' => '', 'blockquote' => '', 'style' => 'vertical', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; if( $animate ) $output .= '
'; if( $heading ) $output .= '

'. $heading .'

'; $output .= ''; $output .= '
'; if( $title ){ $output .= '

'; if( $link ) $output .= ''; $output .= $title; if( $link ) $output .= ''; $output .= '

'; } if( $subtitle ) $output .= '

'. $subtitle .'

'; if( $phone ) $output .= '

'. $phone .'

'; $output .= '
'; $output .= '
'. do_shortcode($content) .'
'; if( $email || $phone || $facebook || $twitter || $linkedin ){ $output .= ''; } if( $blockquote ) $output .= '
'. $blockquote .'
'; $output .= '
'; if( $animate ) $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Our Team List [our_team_list] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_our_team_list' ) ) { function sc_our_team_list( $attr, $content = null ) { extract(shortcode_atts(array( 'image' => '', 'title' => '', 'subtitle' => '', 'blockquote' => '', 'email' => '', 'phone' => '', 'facebook' => '', 'twitter' => '', 'linkedin' => '', 'vcard' => '', 'link' => '', 'target' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target == 'lightbox' ){ $target = 'rel="prettyphoto"'; } elseif( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'; $output .= '
'; if( $title ){ $output .= '

'; if( $link ) $output .= ''; $output .= $title; if( $link ) $output .= ''; $output .= '

'; } if( $subtitle ) $output .= '

'. $subtitle .'

'; if( $phone ) $output .= '

'. $phone .'

'; $output .= '
'; $output .= '
'. do_shortcode($content) .'
'; $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; if( $blockquote ) $output .= '
'. $blockquote .'
'; if( $email || $phone || $facebook || $twitter || $linkedin ){ $output .= ''; } $output .= '
'; $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Portfolio [portfolio] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_portfolio' ) ) { function sc_portfolio( $attr, $content = null ) { extract(shortcode_atts(array( 'count' => 2, 'category' => '', 'category_multi' => '', 'exclude_id' => '', 'orderby' => 'date', 'order' => 'DESC', 'style' => 'list', 'columns' => 3, 'greyscale' => '', 'filters' => '', 'pagination' => '', 'load_more' => '', 'related' => '', ), $attr)); $translate['all'] = mfn_opts_get('translate') ? mfn_opts_get('translate-item-all','All') : __('All','betheme'); // class $class = ''; if( $greyscale ) $class .= ' greyscale'; $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : ( ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1 ); $args = array( 'post_type' => 'portfolio', 'posts_per_page' => intval($count), 'paged' => $paged, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1, ); // categories if( $category_multi = trim( $category_multi ) ){ $category_multi = mfn_wpml_term_slug( $category_multi, 'portfolio-types', 1 ); $args['portfolio-types'] = $category_multi; $category_multi_array = explode( ',', str_replace( ' ', '', $category_multi ) ); } elseif( $category ){ $category = mfn_wpml_term_slug( $category, 'portfolio-types' ); $args['portfolio-types'] = $category; } // exclude posts if( $exclude_id ){ $exclude_id = str_replace( ' ', '', $exclude_id ); $args['post__not_in'] = explode( ',', $exclude_id ); } // related | exclude current if( $related ){ $args['post__not_in'] = array( get_the_ID() ); } $query_portfolio = new WP_Query( $args ); $output = '
'; // Echo | Filters if( $filters && ! $category ){ $output .= '
'; $output .= '
'; $output .= '
    '; $output .= '
  • '. $translate['all'] .'
  • '; if( $portfolio_categories = get_terms( 'portfolio-types' ) ){ foreach( $portfolio_categories as $category ){ if( $category_multi ){ if( in_array( $category->slug, $category_multi_array ) ){ $output .= '
  • '. $category->name .'
  • '; } } else { $output .= '
  • '. $category->name .'
  • '; } } } $output .= '
'; $output .= '
'; $output .= '
'."\n"; } // Echo | Main Content $output .= '
'; $output .= ''; if( $pagination ) $output .= mfn_pagination( $query_portfolio, $load_more ); $output .= '
'."\n"; $output .= '
'."\n"; wp_reset_postdata(); return $output; } } /* --------------------------------------------------------------------------- * Portfolio Grid [portfolio_grid] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_portfolio_grid' ) ) { function sc_portfolio_grid( $attr, $content = null ) { extract(shortcode_atts(array( 'count' => '4', 'category' => '', 'category_multi' => '', 'orderby' => 'date', 'order' => 'DESC', 'greyscale' => '', ), $attr)); // class $class = ''; if( $greyscale ) $class .= ' greyscale'; $args = array( 'post_type' => 'portfolio', 'posts_per_page' => intval($count), 'paged' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1, ); // categories if( $category_multi = trim( $category_multi ) ){ $category_multi = mfn_wpml_term_slug( $category_multi, 'portfolio-types', 1 ); $args['portfolio-types'] = $category_multi; } elseif( $category ){ $category = mfn_wpml_term_slug( $category, 'portfolio-types' ); $args['portfolio-types'] = $category; } $query = new WP_Query(); $query->query( $args ); $post_count = $query->post_count; $output = ''; if ($query->have_posts()) { $output = ''."\n"; } wp_reset_query(); return $output; } } /* --------------------------------------------------------------------------- * Portfolio Photo [portfolio_photo] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_portfolio_photo' ) ) { function sc_portfolio_photo( $attr, $content = null ) { extract(shortcode_atts(array( 'count' => '5', 'category' => '', 'category_multi' => '', 'orderby' => 'date', 'order' => 'DESC', 'target' => '', 'greyscale' => '', 'margin' => '', ), $attr)); // class $class = ''; if( $greyscale ) $class .= ' greyscale'; if( $margin ) $class .= ' margin'; $translate['readmore'] = mfn_opts_get('translate') ? mfn_opts_get('translate-readmore','Read more') : __('Read more','betheme'); $args = array( 'post_type' => 'portfolio', 'posts_per_page' => intval($count), 'paged' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1, ); // categories if( $category_multi = trim( $category_multi ) ){ $category_multi = mfn_wpml_term_slug( $category_multi, 'portfolio-types', 1 ); $args['portfolio-types'] = $category_multi; } elseif( $category ){ $category = mfn_wpml_term_slug( $category, 'portfolio-types' ); $args['portfolio-types'] = $category; } // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } $query = new WP_Query(); $query->query( $args ); $output = ''; if ($query->have_posts()) { $output = '
'; while ($query->have_posts()) { $query->the_post(); // external link to project page if( get_post_meta( get_the_ID(), 'mfn-post-link', true ) ){ $link = get_post_meta( get_the_ID(), 'mfn-post-link', true ); } else { $link = get_permalink(); } // portfolio categories $terms = get_the_terms( get_the_ID(), 'portfolio-types' ); $categories = array(); if( is_array( $terms ) ){ foreach( $terms as $term ){ $categories[] = $term->name; } } $categories = implode(', ', $categories); // image $large_image_url = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_ID() ), 'large' ); $output .= '
'; $output .= ''; $output .= get_the_post_thumbnail( get_the_ID(), 'full' ); $output .= '
'; $output .= '
'; $output .= ''; $output .= '
'; $output .= '

'. get_the_title() .'

'; if( $categories ) $output .= '
'. $categories .'
'; $output .= '
'; $output .= '

'. $translate['readmore'] .'

'; $output .= '
'; $output .= '
'; } $output .= '
'."\n"; } wp_reset_query(); return $output; } } /* --------------------------------------------------------------------------- * Portfolio Slider [portfolio_slider] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_portfolio_slider' ) ) { function sc_portfolio_slider( $attr, $content = null ) { extract(shortcode_atts(array( 'count' => '5', 'category' => '', 'category_multi' => '', 'orderby' => 'date', 'order' => 'DESC', 'arrows' => '', // [default], hover, always 'size' => 'small', // small, medium, large 'scroll' => 'page', // page, slide ), $attr)); $sizes = array( 'small' => 380, 'medium' => 480, 'large' => 638, ); $scrolls = array( 'page' => 5, 'slide' => 1, ); $class = ''; if( $arrows ) $class .= ' arrows arrows_' .$arrows; $args = array( 'post_type' => 'portfolio', 'posts_per_page' => intval($count), 'paged' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1, ); // categories if( $category_multi = trim( $category_multi ) ){ $category_multi = mfn_wpml_term_slug( $category_multi, 'portfolio-types', 1 ); $args['portfolio-types'] = $category_multi; } elseif( $category ){ $category = mfn_wpml_term_slug( $category, 'portfolio-types' ); $args['portfolio-types'] = $category; } $query = new WP_Query(); $query->query( $args ); $output = ''; if ($query->have_posts()) { $output = '
'; $output .= ''; $output .= '
'."\n"; } wp_reset_query(); return $output; } } /* --------------------------------------------------------------------------- * Slides [slides] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_slider' ) ) { function sc_slider( $attr, $content = null ) { extract(shortcode_atts(array( 'category' => '', 'orderby' => 'date', 'order' => 'DESC', 'style' => '', // [default], img-text, flat, carousel 'navigation' => '', ), $attr)); $args = array( 'post_type' => 'slide', 'posts_per_page' => -1, 'paged' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1, ); if( $category ) $args['slide-types'] = $category; $query = new WP_Query(); $query->query( $args ); $post_count = $query->post_count; // class $class = $style; if( $class == 'description' ) $class .= ' flat'; if( $navigation ) $class .= ' '. $navigation; $output = ''; if ($query->have_posts()) { $output .= '
'; $output .= ''; $output .= '
'; $output .= '
'."\n"; } wp_reset_query(); return $output; } } /* --------------------------------------------------------------------------- * Slider Plugin [slider_plugin] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_slider_plugin' ) ) { function sc_slider_plugin( $attr, $content = null ) { extract(shortcode_atts(array( 'rev' => '', 'layer' => '', ), $attr)); $output = ''; if( $rev ){ // Revolution Slider $output .= '
'; $output .= do_shortcode('[rev_slider '. $rev .']'); $output .= '
'; } elseif( $layer ){ // Layer Slider $output .= '
'; $output .= do_shortcode('[layerslider id="'. $layer .'"]'); $output .= '
'; } return $output; } } /* --------------------------------------------------------------------------- * Offer Slider Full [offer] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_offer' ) ) { function sc_offer( $attr = false, $content = null ) { extract(shortcode_atts(array( 'category' => '', 'align' => 'left', ), $attr)); $args = array( 'post_type' => 'offer', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'ignore_sticky_posts' => 1, ); if( $category ) $args['offer-types'] = $category; $offer_query = new WP_Query(); $offer_query->query( $args ); $output = ''; if( $offer_query->have_posts() ) { $output .= '
'; $output .= ''; // pagination $output .= '
1 / '. $offer_query->post_count .'
'; $output .= '
'."\n"; } wp_reset_query(); return $output; } } /* --------------------------------------------------------------------------- * Offer Slider Thumb [offer_thumb] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_offer_thumb' ) ) { function sc_offer_thumb( $attr = false, $content = null ) { extract(shortcode_atts(array( 'category' => '', 'style' => '', 'align' => 'left', ), $attr)); $args = array( 'post_type' => 'offer', 'posts_per_page' => -1, 'orderby' => 'menu_order', 'order' => 'ASC', 'ignore_sticky_posts' => 1, ); if( $category ) $args['offer-types'] = $category; $offer_query = new WP_Query(); $offer_query->query( $args ); $output = ''; if ($offer_query->have_posts()) { $output .= '
'; $output .= ''; // pagination $output .= '
'; $output .= '
'."\n"; } wp_reset_query(); return $output; } } /* --------------------------------------------------------------------------- * Map [map] [/map] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_map' ) ) { function sc_map( $attr, $content = null ) { extract(shortcode_atts(array( 'lat' => '', 'lng' => '', 'zoom' => 13, 'height' => 200, 'type' => 'ROADMAP', 'controls' => '', 'draggable' => '', 'border' => '', 'icon' => '', 'styles' => '', 'latlng' => '', 'title' => '', 'telephone' => '', 'email' => '', 'www' => '', 'style' => 'box', 'uid' => uniqid(), ), $attr)); // image | visual composer fix $icon = mfn_vc_image( $icon ); // border if( $border ){ $class = 'has_border'; } else { $class = 'no_border'; } // controls $zoomControl = $mapTypeControl = $streetViewControl = 'false'; if( ! $controls ) $zoomControl = 'true'; if( strpos( $controls , 'zoom' ) !== false ) $zoomControl = 'true'; if( strpos( $controls , 'mapType' ) !== false ) $mapTypeControl = 'true'; if( strpos( $controls , 'streetView' ) !== false ) $streetViewControl = 'true'; if( $api_key = trim( mfn_opts_get( 'google-maps-api-key' ) ) ){ $api_key = '?key='. $api_key; } wp_enqueue_script( 'google-maps', 'http'. mfn_ssl() .'://maps.google.com/maps/api/js'. $api_key, false, null, true ); $output = ''."\n"; $output .= '
'; if( $title || $content ){ $output .= '
'; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; $output .= '
    '; if( $content ){ $output .= '
  • '; $output .= ''; $output .= ''. do_shortcode($content) .''; $output .= '
  • '; } if( $telephone ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $telephone .'

    '; $output .= '
  • '; } if( $email ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $email .'

    '; $output .= '
  • '; } if( $www ){ $output .= '
  • '; $output .= ''; $output .= '

    '. $www .'

    '; $output .= '
  • '; } $output .= '
'; $output .= '
'; $output .= '
'; $output .= '
'; } $output .= '
 
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Tabs [tabs] * --------------------------------------------------------------------------- */ global $tabs_array, $tabs_count; if( ! function_exists( 'sc_tabs' ) ) { function sc_tabs( $attr, $content = null ) { global $tabs_array, $tabs_count; extract(shortcode_atts(array( 'title' => '', 'tabs' => '', 'type' => '', 'padding' => '', 'uid' => '', ), $attr)); do_shortcode( $content ); // content builder if( $tabs ){ $tabs_array = $tabs; } // uid if( ! $uid ){ $uid = 'tab-'. uniqid(); } // padding if( $padding || $padding === '0' ){ $padding = 'style="padding:'. esc_attr( $padding ) .'"'; } $output = ''; if( is_array( $tabs_array ) ) { if( $title ) $output .= '

'. $title .'

'; $output .= '
'; // contant $output .= ''; // titles $output .= $output_tabs; $output .= '
'; $tabs_array = ''; $tabs_count = 0; } return $output; } } /* --------------------------------------------------------------------------- * _Tab [tab] _private * --------------------------------------------------------------------------- */ $tabs_count = 0; if( ! function_exists( 'sc_tab' ) ) { function sc_tab( $attr, $content = null ) { global $tabs_array, $tabs_count; extract(shortcode_atts(array( 'title' => 'Tab title', ), $attr)); $tabs_array[] = array( 'title' => $title, 'content' => do_shortcode( $content ) ); $tabs_count++; return true; } } /* --------------------------------------------------------------------------- * Accordion [accordion][accordion_item]...[/accordion] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_accordion' ) ) { function sc_accordion( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'tabs' => '', 'open1st' => '', 'openall' => '', 'openAll' => '', 'style' => 'accordion', ), $attr)); // class $class = ''; if( $open1st ) $class .= ' open1st'; if( $openall || $openAll ) $class .= ' openAll'; if( $style == 'toggle' ) $class .= ' toggle'; $output = ''; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; if( is_array( $tabs ) ){ // content builder foreach( $tabs as $tab ){ $output .= '
'; $output .= '
'. $tab['title'] .'
'; $output .= '
'; $output .= do_shortcode($tab['content']); $output .= '
'; $output .= '
'."\n"; } } else { // shortcode $output .= do_shortcode($content); } $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Accordion Item [accordion_item][/accordion_item] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_accordion_item' ) ) { function sc_accordion_item( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', ), $attr)); $output = '
'; $output .= '
'. $title .'
'; $output .= '
'; $output .= do_shortcode( $content ); $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * FAQ [faq][faq_item]../[/faq] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_faq' ) ) { function sc_faq( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'tabs' => '', 'open1st' => '', 'openall' => '', 'openAll' => '', ), $attr)); // class $class = ''; if( $open1st ) $class .= ' open1st'; if( $openall || $openAll ) $class .= ' openAll'; $output = ''; $output .= '
'; if( $title ) $output .= '

'. $title .'

'; $output .= '
'; if( is_array( $tabs ) ){ // content builder $i = 0; foreach( $tabs as $tab ){ $i++; $output .= '
'; $output .= '
'. $i .''. $tab['title'] .'
'; $output .= '
'; $output .= do_shortcode($tab['content']); $output .= '
'; $output .= '
'."\n"; } } else { // shortcode $output .= do_shortcode($content); } $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * FAQ Item [faq_item][/faq_item] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_faq_item' ) ) { function sc_faq_item( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'number' => '1', ), $attr)); $output = '
'; $output .= '
'. $number .''. $title .'
'; $output .= '
'; $output .= do_shortcode( $content ); $output .= '
'; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Progress Icons [progress_icons] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_progress_icons' ) ) { function sc_progress_icons( $attr, $content = null ) { extract(shortcode_atts(array( 'icon' => 'icon-lamp', 'image' => '', 'count' => 5, 'active' => 0, 'background' => '', ), $attr)); $output = '
'; for ($i = 1; $i <= $count; $i++) { if( $image ){ $output .= ''; } else { $output .= ''; } } $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * Progress Bars [progress_bars][bar][/progress_bars] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_progress_bars' ) ) { function sc_progress_bars( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', ), $attr)); $output = '
'; if( $title ) $output .= '

'. $title .'

'; $output .= ''; $output .= '
'."\n"; return $output; } } /* --------------------------------------------------------------------------- * _Bar [bar] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_bar' ) ) { function sc_bar( $attr, $content = null ) { extract(shortcode_atts(array( 'title' => '', 'value' => 0, 'size' => '', ), $attr)); if( $size ) $size = 'style="height:'. intval( $size ) .'px"'; $output = '
  • '; $output .= '
    '; $output .= $title; $output .= ''. intval( $value ) .'%'; $output .= '
    '; $output .= '
    '; $output .= ''; $output .= '
    '; $output .= '
  • '."\n"; return $output; } } /* --------------------------------------------------------------------------- * Timeline [timeline] [/timeline] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_timeline' ) ) { function sc_timeline( $attr, $content = null ) { extract(shortcode_atts(array( 'count' => '', 'tabs' => '', ), $attr)); $output = ''."\n"; return $output; } } /* --------------------------------------------------------------------------- * Testimonials [testimonials] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_testimonials' ) ) { function sc_testimonials( $attr, $content = null ) { extract(shortcode_atts(array( 'category' => '', 'orderby' => 'menu_order', 'order' => 'ASC', 'style' => '', 'hide_photos' => '', ), $attr)); $args = array( 'post_type' => 'testimonial', 'posts_per_page' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1, ); if( $category ) $args['testimonial-types'] = $category; $query_tm = new WP_Query(); $query_tm->query( $args ); // class $class = $style; if( $hide_photos ){ $class .= ' hide-photos'; } $output = ''; if ($query_tm->have_posts()) { $output .= '
    '; // photos | pagination (style !== single-photo) if( $style != 'single-photo' && ! $hide_photos ){ $output .= '
    '; } // testimonials | contant $output .= ''; // photos | pagination (style == single-photo) if( $style == 'single-photo' ){ $output .= '
    '; } $output .= '
    '."\n"; } return $output; } } /* --------------------------------------------------------------------------- * Testimonials List [testimonials_list] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_testimonials_list' ) ) { function sc_testimonials_list( $attr, $content = null ) { extract(shortcode_atts(array( 'category' => '', 'orderby' => 'menu_order', 'order' => 'ASC', 'style' => '', // [default], quote ), $attr)); $args = array( 'post_type' => 'testimonial', 'posts_per_page' => -1, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' =>1, ); if( $category ) $args['testimonial-types'] = $category; $query_tm = new WP_Query(); $query_tm->query( $args ); // class if( $style ){ $class = 'style_'. $style; } else { $class = ''; } $output = ''; if ($query_tm->have_posts()) { $output .= '
    '; while ($query_tm->have_posts()) { $query_tm->the_post(); // classes $class = ''; if( ! has_post_thumbnail() ) $class .= 'no-img'; $output .= '
    '; if( has_post_thumbnail() ){ $output .= '
    '; $output .= ''; $output .= '
    '; } $output .= '
    '; if( $style == 'quote' ){ $output .= '
    '; $output .= '
    '. get_the_content() .'
    '; $output .= '
    '; $output .= '
    '; } $output .= '

    '; if( $link = get_post_meta(get_the_ID(), 'mfn-post-link', true) ) $output .= ''; $output .= get_post_meta(get_the_ID(), 'mfn-post-author', true); if( $link ) $output .= ''; $output .= '

    '; $output .= '

    '. get_post_meta(get_the_ID(), 'mfn-post-company', true) .'

    '; if( $style != 'quote' ){ $output .= '
    '; $output .= '
    '; $output .= '
    '. get_the_content() .'
    '; $output .= '
    '; } $output .= '
    '; $output .= '
    '."\n"; } wp_reset_query(); $output .= '
    '."\n"; } return $output; } } /* --------------------------------------------------------------------------- * Vimeo [video] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_video' ) ) { function sc_video( $attr, $content = null ) { extract(shortcode_atts(array( 'video' => '', 'parameters' => '', 'mp4' => '', 'ogv' => '', 'placeholder' => '', 'html5_parameters' => '', 'width' => '700', 'height' => '400', ), $attr)); // parameters if( $parameters ) $parameters = '&'. $parameters; // HTML5 parameters $html5_default = array( 'autoplay' => 'autoplay="1"', 'controls' => 'controls="1"', 'loop' => 'loop="1"', 'muted' => 'muted="1"', ); if( $html5_parameters ){ $html5_parameters = explode( ';', $html5_parameters ); if( ! $html5_parameters[0] ) $html5_default['autoplay'] = false; if( ! $html5_parameters[1] ) $html5_default['controls'] = false; if( ! $html5_parameters[2] ) $html5_default['loop'] = false; if( ! $html5_parameters[3] ) $html5_default['muted'] = false; } $html5_default = implode( ' ', $html5_default ); // class $class = ( $video ) ? 'iframe' : '' ; if( $width && $height ){ $class .= ' has-wh'; } else { $class .= ' auto-wh'; } $output = '
    '; if( $video ){ // Embed if( is_numeric($video) ){ // Vimeo $output .= ''."\n"; } else { // YouTube $output .= ''."\n"; } } elseif( $mp4 ){ // HTML5 $output .= '
    '; $output .= '
    '; $poster = ( $placeholder ) ? $placeholder : false; $output .= ''; $output .= '
    '; } $output .= '
    '."\n"; return $output; } } /* --------------------------------------------------------------------------- * _Item [item] [feature_list][item][/feature_list] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_item' ) ) { function sc_item( $attr, $content = null ) { extract(shortcode_atts(array( 'icon' => 'icon-picture', 'title' => '', 'link' => '', 'target' => '', 'animate' => '', ), $attr)); // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
  • '; if( $animate ) $output .= '
    '; if( $link ) $output .= ''; $output .= ''; $output .= ''; $output .= ''; $output .= '

    '. $title .'

    '; if( $link ) $output .= '
    '; if( $animate ) $output .= '
    '; $output .= '
  • '."\n"; return $output; } } /* --------------------------------------------------------------------------- * Feature List [feature_list] [feature_list][item][/feature_list] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_feature_list' ) ) { function sc_feature_list( $attr, $content = null ) { extract(shortcode_atts(array( 'columns' => 4, ), $attr)); $output = '
    '; $output .= ''; $output .= '
    '."\n"; return $output; } } /* --------------------------------------------------------------------------- * List [list][/list] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_list' ) ) { function sc_list( $attr, $content = null ) { extract(shortcode_atts(array( 'icon' => 'icon-picture', 'image' => '', 'title' => '', 'link' => '', 'target' => '', 'style' => 1, 'animate' => '', ), $attr)); // image | visual composer fix $image = mfn_vc_image( $image ); // target if( $target ){ $target = 'target="_blank"'; } else { $target = false; } $output = '
    '; if( $animate ) $output .= '
    '; if( $link ) $output .= ''; if( $style == 4 ){ $output .= '
    '. $title .'
    '; } elseif( $image ){ $output .= '
    '; $output .= ''. mfn_get_attachment_data( $image, 'alt' ) .''; $output .= '
    '; } else { $output .= '
    '; $output .= ''; $output .= '
    '; } $output .= '
    '; if( $title && $style != 4 ) $output .= '

    '. $title .'

    '; $output .= '
    '. do_shortcode( $content ) .'
    '; $output .= '
    '; if( $link ) $output .= '
    '; if( $animate ) $output .= '
    '; $output .= '
    '."\n"; return $output; } } /* --------------------------------------------------------------------------- * Gallery [gallery] * --------------------------------------------------------------------------- */ if( ! function_exists( 'sc_gallery' ) ) { function sc_gallery( $attr ) { $post = get_post(); static $instance = 0; $instance++; if ( ! empty( $attr['ids'] ) ) { // 'ids' is explicitly ordered, unless you specify otherwise. if ( empty( $attr['orderby'] ) ) { $attr['orderby'] = 'post__in'; } $attr['include'] = $attr['ids']; } // We're trusting author input, so let's at least make sure it looks like a valid orderby statement if ( isset( $attr['orderby'] ) ) { $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] ); if ( ! $attr['orderby'] ) { unset( $attr['orderby'] ); } } $html5 = current_theme_supports( 'html5', 'gallery' ); $atts = shortcode_atts( array( 'order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post ? $post->ID : 0, 'itemtag' => $html5 ? 'figure' : 'dl', 'icontag' => $html5 ? 'div' : 'dt', 'captiontag' => $html5 ? 'figcaption' : 'dd', 'columns' => 3, 'size' => 'thumbnail', 'include' => '', 'exclude' => '', 'link' => '', // mfn custom --------------------------- 'style' => '', // [default], flat, fancy, masonry 'greyscale' => '', ), $attr, 'gallery' ); // Muffin | Custom Classes ----------------- $class = $atts['link']; if( $atts['style'] ) $class .= ' '. $atts['style']; if( $atts['greyscale'] ) $class .= ' greyscale'; if( $atts['greyscale'] ) $class .= ' greyscale'; $id = intval( $atts['id'] ); if ( 'RAND' == $atts['order'] ) { $atts['orderby'] = 'none'; } if ( ! empty( $atts['include'] ) ) { $_attachments = get_posts( array( 'include' => $atts['include'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); $attachments = array(); foreach ( $_attachments as $key => $val ) { $attachments[$val->ID] = $_attachments[$key]; } } elseif ( ! empty( $atts['exclude'] ) ) { $attachments = get_children( array( 'post_parent' => $id, 'exclude' => $atts['exclude'], 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); } else { $attachments = get_children( array( 'post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $atts['order'], 'orderby' => $atts['orderby'] ) ); } if ( empty( $attachments ) ) { return ''; } if ( is_feed() ) { $output = "\n"; foreach ( $attachments as $att_id => $attachment ) { $output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n"; } return $output; } $itemtag = tag_escape( $atts['itemtag'] ); $captiontag = tag_escape( $atts['captiontag'] ); $icontag = tag_escape( $atts['icontag'] ); $valid_tags = wp_kses_allowed_html( 'post' ); if ( ! isset( $valid_tags[ $itemtag ] ) ) { $itemtag = 'dl'; } if ( ! isset( $valid_tags[ $captiontag ] ) ) { $captiontag = 'dd'; } if ( ! isset( $valid_tags[ $icontag ] ) ) { $icontag = 'dt'; } $columns = intval( $atts['columns'] ); // $itemwidth = $columns > 0 ? floor(100/$columns) : 100; $itemwidth = $columns > 0 ? ( ceil(100/$columns*100)/100 - 0.01 ) : 100; $float = is_rtl() ? 'right' : 'left'; $selector = "gallery-{$instance}"; $gallery_style = ''; if ( apply_filters( 'use_default_gallery_style', ! $html5 ) ) { $gallery_style = " \n\t\t"; } $size_class = sanitize_html_class( $atts['size'] ); $gallery_div = "\n"; return $output; } } // column shortcodes ----------------------- add_shortcode( 'one', 'sc_one' ); add_shortcode( 'one_second', 'sc_one_second' ); add_shortcode( 'one_third', 'sc_one_third' ); add_shortcode( 'two_third', 'sc_two_third' ); add_shortcode( 'one_fourth', 'sc_one_fourth' ); add_shortcode( 'two_fourth', 'sc_one_second' ); add_shortcode( 'three_fourth', 'sc_three_fourth' ); add_shortcode( 'one_fifth', 'sc_one_fifth' ); add_shortcode( 'two_fifth', 'sc_two_fifth' ); add_shortcode( 'three_fifth', 'sc_three_fifth' ); add_shortcode( 'four_fifth', 'sc_four_fifth' ); add_shortcode( 'one_sixth', 'sc_one_sixth' ); add_shortcode( 'two_sixth', 'sc_one_third' ); add_shortcode( 'three_sixth', 'sc_one_second' ); add_shortcode( 'four_sixth', 'sc_two_third' ); add_shortcode( 'five_sixth', 'sc_five_sixth' ); // content shortcodes ---------------------- add_shortcode( 'alert', 'sc_alert' ); add_shortcode( 'blockquote', 'sc_blockquote' ); add_shortcode( 'button', 'sc_button' ); add_shortcode( 'code', 'sc_code' ); add_shortcode( 'content_link', 'sc_content_link' ); add_shortcode( 'divider', 'sc_divider' ); add_shortcode( 'dropcap', 'sc_dropcap' ); add_shortcode( 'fancy_link', 'sc_fancy_link' ); add_shortcode( 'google_font', 'sc_google_font' ); add_shortcode( 'heading', 'sc_heading' ); add_shortcode( 'highlight', 'sc_highlight' ); add_shortcode( 'hr', 'sc_divider' ); // do not change, alias for [divider] shortcode add_shortcode( 'icon', 'sc_icon' ); add_shortcode( 'icon_bar', 'sc_icon_bar' ); add_shortcode( 'icon_block', 'sc_icon_block' ); add_shortcode( 'idea', 'sc_idea' ); add_shortcode( 'image', 'sc_image' ); add_shortcode( 'popup', 'sc_popup' ); add_shortcode( 'progress_icons', 'sc_progress_icons' ); add_shortcode( 'share_box', 'sc_share_box' ); add_shortcode( 'tooltip', 'sc_tooltip' ); add_shortcode( 'tooltip_image', 'sc_tooltip_image' ); add_shortcode( 'video_embed', 'sc_video' ); // WordPress has default [video] shortcode // builder shortcodes ---------------------- add_shortcode( 'accordion', 'sc_accordion' ); add_shortcode( 'accordion_item', 'sc_accordion_item' ); add_shortcode( 'article_box', 'sc_article_box' ); add_shortcode( 'before_after', 'sc_before_after' ); add_shortcode( 'blog', 'sc_blog' ); add_shortcode( 'blog_news', 'sc_blog_news' ); add_shortcode( 'blog_slider', 'sc_blog_slider' ); add_shortcode( 'blog_teaser', 'sc_blog_teaser' ); add_shortcode( 'call_to_action', 'sc_call_to_action' ); add_shortcode( 'chart', 'sc_chart' ); add_shortcode( 'clients', 'sc_clients' ); add_shortcode( 'clients_slider', 'sc_clients_slider' ); add_shortcode( 'contact_box', 'sc_contact_box' ); add_shortcode( 'countdown', 'sc_countdown' ); add_shortcode( 'counter', 'sc_counter' ); add_shortcode( 'fancy_divider', 'sc_fancy_divider' ); add_shortcode( 'fancy_heading', 'sc_fancy_heading' ); add_shortcode( 'faq', 'sc_faq' ); add_shortcode( 'faq_item', 'sc_faq_item' ); add_shortcode( 'feature_box', 'sc_feature_box' ); add_shortcode( 'feature_list', 'sc_feature_list' ); add_shortcode( 'flat_box', 'sc_flat_box' ); add_shortcode( 'helper', 'sc_helper' ); add_shortcode( 'hover_box', 'sc_hover_box' ); add_shortcode( 'hover_color', 'sc_hover_color' ); add_shortcode( 'how_it_works', 'sc_how_it_works' ); add_shortcode( 'icon_box', 'sc_icon_box' ); add_shortcode( 'info_box', 'sc_info_box' ); add_shortcode( 'list', 'sc_list' ); add_shortcode( 'map', 'sc_map' ); add_shortcode( 'offer', 'sc_offer' ); add_shortcode( 'offer_thumb', 'sc_offer_thumb' ); add_shortcode( 'opening_hours', 'sc_opening_hours' ); add_shortcode( 'our_team', 'sc_our_team' ); add_shortcode( 'our_team_list', 'sc_our_team_list' ); add_shortcode( 'photo_box', 'sc_photo_box' ); add_shortcode( 'portfolio', 'sc_portfolio' ); add_shortcode( 'portfolio_grid', 'sc_portfolio_grid' ); add_shortcode( 'portfolio_photo', 'sc_portfolio_photo' ); add_shortcode( 'portfolio_slider', 'sc_portfolio_slider' ); add_shortcode( 'pricing_item', 'sc_pricing_item' ); add_shortcode( 'progress_bars', 'sc_progress_bars' ); add_shortcode( 'promo_box', 'sc_promo_box' ); add_shortcode( 'quick_fact', 'sc_quick_fact' ); add_shortcode( 'shop_slider', 'sc_shop_slider' ); add_shortcode( 'slider', 'sc_slider' ); add_shortcode( 'sliding_box', 'sc_sliding_box' ); add_shortcode( 'story_box', 'sc_story_box' ); add_shortcode( 'tabs', 'sc_tabs' ); add_shortcode( 'tab', 'sc_tab' ); add_shortcode( 'testimonials', 'sc_testimonials' ); add_shortcode( 'testimonials_list', 'sc_testimonials_list' ); add_shortcode( 'trailer_box', 'sc_trailer_box' ); add_shortcode( 'zoom_box', 'sc_zoom_box' ); // private shortcodes ---------------------- add_shortcode( 'bar', 'sc_bar' ); add_shortcode( 'item', 'sc_item' ); // replace WP shortcode -------------------- if( ! mfn_opts_get( 'sc-gallery-disable' ) ){ remove_shortcode( 'gallery' ); add_shortcode( 'gallery' , 'sc_gallery' ); }