Beispiel #1
0
 function st_vc_about_icon($attr, $content = false)
 {
     $data = shortcode_atts(array('st_icon' => '', 'st_name' => '', 'st_description' => '', 'st_link' => '', 'st_pos_icon' => 'top', 'st_color_icon' => '', 'st_size_icon' => 'box-icon-sm', 'st_text_align' => 'text-center', 'st_border' => '', 'st_to_color' => 'black'), $attr, 'st_about_icon');
     extract($data);
     $icons_center = '';
     if ($st_text_align == 'text-center') {
         $icons_center = 'box-icon-center';
     }
     $class_bg_color = Assets::build_css("background: " . $st_color_icon . "");
     if (!empty($st_border)) {
         $class_bg_color = Assets::build_css("border-color: " . $st_color_icon . "!important;\r\n                                                 color: " . $st_color_icon . "!important;");
     }
     if (empty($st_link)) {
         $title = '<h4 class="thumb-title">' . $st_name . '</h4>';
     } else {
         $title = ' <h5 class="thumb-title">
                     <a href="' . $st_link . '" class="text-darken">' . $st_name . '</a>
                    </h5>';
     }
     $txt = '
                 <div class="thumb ' . $st_text_align . '">
                         <header class="thumb-header pull-' . $st_pos_icon . ' st-thumb-header">
                            <i class="fa ' . $st_icon . ' ' . $st_size_icon . ' box-icon-' . $st_pos_icon . ' ' . $icons_center . ' round ' . $class_bg_color . ' animate-icon-top-to-bottom ' . $st_border . '  box-icon-to-' . $st_to_color . ' "></i>
                         </header>
                         <div class="thumb-caption pull-' . $st_pos_icon . ' st-thumb-caption">
                              ' . $title . '
                             <p class="thumb-desc">' . $st_description . '</p>
                         </div>
                 </div>
                 ';
     return $txt;
 }
Beispiel #2
0
 function st_vc_icon($attr, $content = false)
 {
     $data = shortcode_atts(array('st_tooltip' => '', 'st_pos_tooltip' => 'none', 'st_icon' => '', 'st_color_icon' => '', 'st_to_color' => '', 'st_size_icon' => 'box-icon-sm', 'st_round' => '', 'st_border' => '', 'st_animation' => '', 'st_aligment' => 'box-icon-none'), $attr, 'st_about_icon');
     extract($data);
     $class_bg_color = Assets::build_css("background: " . $st_color_icon . "");
     $class_bg_to_color = Assets::build_css("background: " . $st_to_color . ";\r\n                                                border-color: " . $st_to_color . ";\r\n                                                ", ":hover");
     if ($st_animation == "border-rise") {
         $class__ = Assets::build_css("box-shadow: 0 0 0 2px " . $st_to_color . " ", ":after");
         $class_bg_to_color = $class_bg_to_color . " " . $class__;
     }
     if (!empty($st_border)) {
         $class_bg_color = Assets::build_css("border-color: " . $st_color_icon . ";\r\n                                                 color: " . $st_color_icon . ";");
     }
     if (!$st_pos_tooltip or $st_pos_tooltip != 'none') {
         $html_tooltip = 'data-placement="' . $st_pos_tooltip . '" title="" rel="tooltip" data-original-title="' . $st_tooltip . '"';
     } else {
         $html_tooltip = "";
     }
     if (!empty($st_animation)) {
         $animate = "animate-icon-" . $st_animation;
     } else {
         $animate = "";
     }
     $txt = '<i class="fa ' . $st_icon . ' ' . $st_size_icon . ' ' . $st_border . ' ' . $st_aligment . ' ' . $class_bg_color . ' ' . $st_round . ' ' . $class_bg_to_color . ' ' . $animate . ' " ' . $html_tooltip . '> </i>';
     return $txt;
 }
Beispiel #3
0
 function st_vc_gird($attr, $content = false)
 {
     $data = shortcode_atts(array('st_color' => '', 'st_size' => 'col-md-1'), $attr, 'st_gird');
     extract($data);
     $class = Assets::build_css('background : ' . $st_color . ' ; height : 20px');
     $txt = '<div class="row"><div class="demo-grid">
                 <div class="' . $st_size . '">
                     <div class="' . $class . '"></div>
                 </div>
            </div></div>';
     return $txt;
 }
Beispiel #4
0
 function st_vc_bg_gallery($attr, $content = false)
 {
     wp_enqueue_script('gridrotator.js');
     $data = shortcode_atts(array('st_images_in' => 0, 'st_images_not_in' => 0, 'st_col' => 8, 'st_row' => 4, 'st_speed' => 1200, 'opacity' => '0.5'), $attr, 'st_bg_gallery');
     extract($data);
     $per_page = $st_col * $st_row + 5;
     $query_images_args = array('post_type' => 'attachment', 'post_status' => 'public', 'posts_per_page' => $per_page, 'post__not_in' => explode(',', $st_images_not_in), 'post__in' => explode(',', $st_images_in));
     $list = query_posts($query_images_args);
     $txt = '';
     $int_i = 0;
     $int_i = count($list);
     //var_dump($query_images_args);
     //var_dump($list);
     foreach ($list as $k => $v) {
         $image = wp_get_attachment_image($v->ID, array(300, 300));
         $txt .= '<li class="image-' . $v->ID . '">
                     <a href="#">
                         ' . $image . '
                     </a>
                  </li>';
     }
     wp_reset_query();
     if ($list_in = count(explode(',', $st_images_in)) < $per_page) {
         $query_images_args = array('post_type' => 'attachment', 'post_mime_type' => 'image', 'post_status' => 'inherit', 'posts_per_page' => $per_page - $list_in, 'post__not_in' => explode(',', $st_images_not_in . ',' . $st_images_in));
         $list = query_posts($query_images_args);
         foreach ($list as $k => $v) {
             $image = wp_get_attachment_image($v->ID, array(300, 300));
             $txt .= '<li class="image-' . $v->ID . '">
                     <a href="#">
                         ' . $image . '
                     </a>
                  </li>';
             // $int_i++;
         }
         wp_reset_query();
     }
     $class_bg = Assets::build_css("opacity: " . $opacity . "!important;");
     $r = '<div class="bg-holder">
                 <div class="bg-mask-darken ' . $class_bg . '"></div>
                 <div class="bg-parallax"></div>
                 <!-- START GRIDROTATOR -->
                  <div class="ri-grid" id="ri-grid" xcount="' . $int_i . '" data-col="' . $st_col . '" data-row="' . $st_row . '" data-speed="' . $st_speed . '">
                     <ul>' . $txt . '</ul>
                 </div>
                 <!-- END GRIDROTATOR -->
                 <div class="bg-front full-center">
                     <div class="container">
                         ' . st()->load_template('vc-elements/st-search/search', 'form', array('st_style_search' => 'style_1', 'st_box_shadow' => 'no', 'class' => '')) . '
                     </div>
                 </div>
             </div>';
     return $r;
 }
Beispiel #5
0
 function st_vc_twitter($arg, $content = false)
 {
     $data = shortcode_atts(array('st_twitter_number' => 5, 'st_twitter_user' => 'evanto', 'st_color' => '#fff'), $arg, 'st_twitter');
     extract($data);
     //require_once 'TwitterAPIExchange.php';
     if ($st_twitter_user) {
         //get twitter
         $settings = array('oauth_access_token' => "460485056-XHfLUud3fQToKfseTnoaiSLrWrdKnsiEyiCaJHLX", 'oauth_access_token_secret' => "GmYQbQcDXdiWBJFH39GgyG7i7fxVcfaQQT0YgCgh015f7", 'consumer_key' => "18ihEuNsfOJokCLb8SAgA", 'consumer_secret' => "7vTYnLYYiP4BhXvkMWtD3bGnysgiGqYlsPFfwXhGk");
         $num = $st_twitter_number;
         $url = 'https://api.twitter.com/1.1/statuses/user_timeline.json';
         $getfield = '?screen_name=' . $st_twitter_user . '&count=' . $num;
         $requestMethod = 'GET';
         $twitter = new TwitterAPIExchange($settings);
         $recent_twitter = $twitter->setGetfield($getfield)->buildOauth($url, $requestMethod)->performRequest();
         $twitters = json_decode($recent_twitter, true);
         $output = array();
         $txt = "";
         $class = "";
         if (!empty($st_color)) {
             $class = Assets::build_css("color: " . $st_color);
             Assets::add_css("\r\n                    .{$class} .owl-controls .owl-buttons div{\r\n                        background:{$st_color};\r\n                    }\r\n                ");
         }
         if (!isset($twitters['errors']) && count($twitters) > 0) {
             foreach ($twitters as $twitter) {
                 $txt .= '<div class="item">
                             <div class="icon pull-left">
                                 <i class="fa fa-twitter"></i>
                             </div>
                             <div class="txt">
                                 <span class="tweet_time">
                                     <a class="' . $class . '" title="view tweet on twitter" href="http://twitter.com/' . $st_twitter_user . "/status/" . $twitter['id'] . '">' . human_time_diff(strtotime($twitter['created_at'])) . ' ago :</a>
                                  </span>
                                  <span class="tweet_text">
                                    ' . $twitter['text'] . '
                                  </span>
                             </div>
                         </div>';
             }
         }
     }
     $r = st()->load_template('vc-elements/st-twitter/html', null, array('html' => $txt, 'st_color' => $st_color, 'class' => $class));
     return $r;
 }
 function st_vc_testimonial($attr, $content = false)
 {
     $data = shortcode_atts(array('st_style' => 'style1', 'st_avatar' => 0, 'st_color' => "#000", 'st_testimonial_color' => "", 'st_name' => 0, 'st_sub' => '', 'st_desc' => ''), $attr, 'st_testimonial');
     extract($data);
     $img = wp_get_attachment_image_src($st_avatar, array(50, 50));
     $class_color = Assets::build_css('color : ' . $st_color);
     if ($st_style == 'style1') {
         $txt = '  <div class="testimonial ' . $class_color . ' ' . $st_testimonial_color . ' hidden-sm hidden-xs">
                     <div class="testimonial-inner ">
                         <blockquote>
                             <p>' . $st_desc . '</p>
                         </blockquote>
                     </div>
                     <div class="testimonial-author">
                         <img src="' . $img[0] . '" alt="Avatar" title="' . $st_name . '" />
                         <p class="testimonial-author-name" >' . $st_name . '</p>
                         <cite>' . $st_sub . '</cite>
                     </div>
                 </div>';
     }
     if ($st_style == 'style2') {
         $txt = '  <div class="testimonial style2 hidden-sm hidden-xs ' . $class_color . ' ' . $st_testimonial_color . '">
                     <div class="testimonial-inner">
                         <div class="row">
                             <div class="col-md-3">
                                  <img src="' . $img[0] . '" alt="Avatar" title="' . $st_name . '" />
                             </div>
                             <div class="col-md-8">
                                  <blockquote>
                                     <p>' . $st_desc . '</p>
                                  </blockquote>
                             </div>
                         </div>
                     </div>
                     <div class="testimonial-author">
                         <p class="testimonial-author-name dark" >' . $st_name . '</p>
                         <cite>' . $st_sub . '</cite>
                     </div>
                 </div>';
     }
     return $txt;
 }
        public function widget($args, $instance)
        {
            $default = array('title' => '', 'title_bg' => '');
            $instance = wp_parse_args($instance, $default);
            $section_title_class = '';
            if ($instance['title_bg']) {
                $section_title_class = Assets::build_css('
                    background-color:' . $instance['title_bg'] . ';
                  ');
            }
            ?>
                <div class="st_sidebar_section_wrap">
                    <div class="sidebar_section_title <?php 
            echo esc_attr($section_title_class);
            ?>
">
                        <?php 
            echo $instance['title'];
            ?>
                    </div>
                    <div class="sidebar_section_content">
            <?php 
        }
Beispiel #8
0
<?php

$img_bg = wp_get_attachment_image_src($st_bg, 'full');
$img_avatar = wp_get_attachment_image_src($st_avatar, 'full');
$class_bg_img = Assets::build_css(" background: url(" . $img_bg[0] . ") ");
?>
<div class="bg-holder full">
    <div class="bg-mask"></div>
    <div class="bg-img <?php 
echo esc_attr($class_bg_img);
?>
"></div>
    <div class="bg-content">
        <div class="container">
            <div class="row">
                <div class="col-md-12 testimonial_content <?php 
//echo esc_attr("col-md-offset-".$st_pos)
?>
">
                    <!-- START TESTIMONIAL -->
                    <div class="testimonial text-white mt50">
                        <div class="testimonial-inner">
                            <blockquote>
                                <p><?php 
echo esc_html($st_desc);
?>
</p>
                            </blockquote>
                        </div>
                        <div class="testimonial-author">
                            <img src="<?php 
body_class('full');
?>
>
    <?php 
do_action('before_body_content');
?>
    <?php 
$class_bg_img = "";
$class_bg_blur = "";
if (has_post_thumbnail(get_the_ID())) {
    $img = $thumb_url_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true);
    $class_bg_img = Assets::build_css("\r\n                                            background: url(" . $img[0] . ")\r\n                                         ");
}
if (is_404()) {
    $img = st()->get_option('404_bg');
    $class_bg_blur = Assets::build_css("\r\n                                            background: url(" . $img . ")\r\n                                         ");
}
?>
<div class="global-wrap <?php 
echo apply_filters('st_container', true);
?>
">
<div class="row st-full">
    <div class="full-page <?php 
if (is_page_template("tempalate-commingsoon.php")) {
    echo "text-center";
}
if (is_404()) {
    echo "full_404";
}
?>
Beispiel #10
0
<?php

$img = wp_get_attachment_image_src($st_bg_img, 'full');
$class_bg_img = Assets::build_css('background-image: url("' . $img[0] . '") ;');
$class_bg_color = Assets::build_css('background: ' . $st_bg . ' ;');
if (is_numeric($st_opacity)) {
    $st_opacity = 1 - $st_opacity / 100;
} else {
    $st_opacity = 0.5;
}
$class_opacity = Assets::build_css('opacity: ' . $st_opacity . ' ;');
?>
<a href="<?php 
echo esc_url($st_link);
?>
">
    <div class="promotion hover-img">
        <div class="promotion_image ">
            <?php 
if (!empty($img[0])) {
    ?>
                <img src="<?php 
    echo balanceTags($img[0]);
    ?>
" alt="img">
            <?php 
}
?>
        </div>
        <div class="promotion_bg <?php 
echo esc_attr($class_opacity);