Пример #1
0
 /**
  *
  */
 function widget($args, $instance)
 {
     global $wpdb, $shortname, $irish_framework_params;
     $prefix = MISS_PREFIX;
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Posts', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base);
     $tagline = apply_filters('widget_tagline', empty($instance['tagline']) ? '' : '<h6>' . $instance['tagline'] . '</h6>', $instance, $this->id_base);
     if (!($number = (int) $instance['number'])) {
         $number = 3;
     } else {
         if ($number < 1) {
             $number = 1;
         } else {
             if ($number > 15) {
                 $number = 15;
             }
         }
     }
     $out = $before_widget;
     $out .= $before_title . $title . $after_title . $tagline;
     $disable_thumb = $instance['disable_thumb'] ? '1' : '0';
     $show_rating = isset($instance['show_rating']) ? '1' : '0';
     $recent_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1));
     if ($recent_query->have_posts()) {
         $out .= '<ul class="post_list small_post_list">';
         while ($recent_query->have_posts()) {
             $recent_query->the_post();
             $out .= '<li class="post_list_module">';
             /*				
             					$out .= miss_get_post_image( $filter_args );
             				$get_year = get_the_time( 'Y', get_the_ID() );
             				$get_month = get_the_time( 'm', get_the_ID() );
              else {
             					$out .= '<div class="month pull-left">';
             					$out .= '<span class="day">';
             					$out .= get_the_date('d');
             					$out .= '</span>';
             					$out .= get_the_date('M');
             					$out .= '</div>';
             				}
             */
             if (!$disable_thumb) {
                 $widget_thumb_img = $irish_framework_params->layout['big_sidebar_images']['small_post_list'];
                 $out .= miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false));
             }
             $out .= '<p class="post_title">';
             $out .= '<a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>';
             $out .= '</p>';
             $out .= '<div class="post_excerpt">';
             $out .= miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', 60), apply_filters('miss_excerpt', THEME_ELLIPSIS));
             $out .= '</div>';
             $out .= '<div class="clearboth"></div>';
             $out .= '</li>';
         }
         $out .= '</ul>';
     }
     $out .= $after_widget;
     wp_reset_postdata();
     echo $out;
 }
Пример #2
0
 /**
  *
  */
 function widget($args, $instance)
 {
     global $wpdb, $shortname, $irish_framework_params;
     $prefix = MISS_PREFIX;
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent News', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base);
     $tagline = apply_filters('widget_tagline', empty($instance['tagline']) ? '' : '<h6>' . $instance['tagline'] . '</h6>', $instance, $this->id_base);
     if (!($number = (int) $instance['number'])) {
         $number = 3;
     } else {
         if ($number < 1) {
             $number = 1;
         } else {
             if ($number > 15) {
                 $number = 15;
             }
         }
     }
     $out = $before_widget;
     $out .= $before_title . $title . $after_title . $tagline;
     $disable_thumb = $instance['disable_thumb'] ? '1' : '0';
     $show_rating = isset($instance['show_rating']) ? '1' : '0';
     $recent_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'post_type' => 'vacancy', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1));
     if ($recent_query->have_posts()) {
         $out .= '<ul class="post_list small_post_list">';
         while ($recent_query->have_posts()) {
             $recent_query->the_post();
             $out .= '<li class="post_list_module">';
             $out .= '<div class="month pull-left">';
             $out .= '<span class="day">';
             $out .= get_the_date('d');
             $out .= '</span>';
             $out .= get_the_date('M');
             $out .= '</div>';
             $out .= '<p class="post_title">';
             $out .= '<a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>';
             $out .= '</p>';
             $out .= '<div class="post_excerpt">';
             $out .= miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', 55), apply_filters('miss_excerpt', THEME_ELLIPSIS));
             $out .= '</div>';
             if ($show_rating && score_value(get_the_ID()) != 0) {
                 $postid = get_the_ID();
                 $score = score_value($postid);
                 $out .= '<div class="rating_box">' . score_output($score, 'small') . '</div>';
             }
             $out .= '</li>';
         }
         $out .= '</ul>';
     }
     $out .= $after_widget;
     wp_reset_postdata();
     echo $out;
 }
Пример #3
0
 function miss_raw_excerpt($buffer)
 {
     return miss_excerpt($buffer, 20, '');
 }
Пример #4
0
"><?php 
        echo miss_post_title($filter_args);
        ?>
</a></div>
                    <div class="article-info">
                        <span class="item"><span>Posted</span> <?php 
        the_author();
        ?>
</span>
                        <span class="item"><span>Comments</span> (<?php 
        comments_number('0', '1', '%');
        ?>
)</span>
                    </div>
                    <div class="article-text"><?php 
        echo miss_excerpt(get_the_excerpt(), 2000, THEME_ELLIPSIS);
        ?>
</div>
                    <?php 
        $posttags = get_the_tags();
        if ($posttags) {
            ?>
                    <div class="article-tags">
                        <span>Tags:</span>
                        <?php 
            foreach ($posttags as $tag) {
                echo '<a href="' . get_tag_link($tag->term_id) . '">' . $tag->name . '</a>,';
            }
            ?>
                    </div>
                    <?php 
Пример #5
0
 /**
  *
  */
 function widget($args, $instance)
 {
     global $wpdb, $irish_framework_params;
     $prefix = MISS_PREFIX;
     extract($args);
     $out = '';
     if (!($popular_number = (int) $instance['popular_number'])) {
         $popular_number = 3;
     } else {
         if ($popular_number < 1) {
             $popular_number = 1;
         } else {
             if ($popular_number > 15) {
                 $popular_number = 15;
             }
         }
     }
     if (!($recent_number = (int) $instance['recent_number'])) {
         $recent_number = 3;
     } else {
         if ($recent_number < 1) {
             $recent_number = 1;
         } else {
             if ($recent_number > 15) {
                 $recent_number = 15;
             }
         }
     }
     if (!($comments_number = (int) $instance['comments_number'])) {
         $comments_number = 3;
     } else {
         if ($comments_number < 1) {
             $comments_number = 1;
         } else {
             if ($comments_number > 15) {
                 $comments_number = 15;
             }
         }
     }
     $datastore = array('top' => array('title' => __('Popular', MISS_TEXTDOMAIN), 'data' => array()), 'new' => array('title' => __('Recent', MISS_TEXTDOMAIN), 'data' => array()), 'all' => array('icon' => 'fa-icon-comment', 'data' => array()));
     echo $before_widget;
     $count = !empty($count) ? trim($count) : '3';
     $disable_thumb = $instance['disable_thumb'] ? '1' : '0';
     $popular_query = new WP_Query(array('showposts' => $popular_number, 'nopaging' => 0, 'orderby' => 'comment_count', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1));
     $i = 0;
     while ($popular_query->have_posts()) {
         $popular_query->the_post();
         $i++;
         if (!$disable_thumb) {
             $widget_thumb_img = $irish_framework_params->layout['big_sidebar_images']['small_post_list'];
             $datastore['top']['data'][$i]['image'] = miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false));
         } else {
             $widget_thumb_img = array('', '');
         }
         $datastore['top']['data'][$i]['url'] = esc_url(get_permalink());
         $datastore['top']['data'][$i]['title'] = get_the_title();
         $datastore['top']['data'][$i]['content'] = miss_excerpt(get_the_excerpt(), 40, THEME_ELLIPSIS);
     }
     $recent_query = new WP_Query(array('showposts' => $recent_number, 'nopaging' => 0, 'orderby' => 'post_date', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1));
     $i = 0;
     while ($recent_query->have_posts()) {
         $recent_query->the_post();
         $i++;
         if (!$disable_thumb) {
             $widget_thumb_img = $irish_framework_params->layout['big_sidebar_images']['small_post_list'];
             $datastore['new']['data'][$i]['image'] = miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false));
         } else {
             $widget_thumb_img = array('', '');
         }
         $datastore['new']['data'][$i]['url'] = esc_url(get_permalink());
         $datastore['new']['data'][$i]['title'] = get_the_title();
         $datastore['new']['data'][$i]['content'] = miss_excerpt(get_the_excerpt(), 40, THEME_ELLIPSIS);
         $datastore['new']['data'][$i]['d'] = get_the_date('d');
         $datastore['new']['data'][$i]['M'] = get_the_date('M');
     }
     $comments = get_comments(array('number' => $comments_number, 'status' => 'approve'));
     foreach ($comments as $comment) {
         $i++;
         $datastore['all']['data'][$i] = array('content' => $comment->comment_content, 'post_id' => $comment->comment_post_ID, 'url' => get_permalink($comment->comment_post_ID), 'title' => get_the_title($comment->comment_post_ID));
     }
     $out .= '<div class="module-posts">';
     $out .= '<div class="posts-heading"><ul class="posts-row">';
     $i = 0;
     foreach ($datastore as $key => $items) {
         $class = $i == 0 ? ' active' : '';
         //			print_r($items);
         $out .= '<li class="posts-cell ' . $class . '">';
         $out .= '<a href="#" data-block="' . $key . '-posts">';
         $out .= isset($items['icon']) ? '<i class="' . $items['icon'] . '"></i> ' : '';
         $out .= isset($items['title']) ? $items['title'] : '';
         $out .= '</a>';
         $out .= '</li>';
         $i++;
     }
     $out .= '<div class="clearboth"></div>';
     $out .= '</ul></div>';
     $out .= '<div class="posts-content">';
     foreach ($datastore as $key => $items) {
         $out .= '<div class="posts-block ' . $key . '-posts">';
         foreach ($items['data'] as $id => $item) {
             if (isset($item['content']) && !empty($item['content'])) {
                 $out .= '<div class="author">';
                 $out .= isset($item['image']) && !empty($item['image']) ? $item['image'] : '';
                 $out .= '<div class="desc">';
                 $out .= isset($item['title']) && !empty($item['title']) ? '<div class="name">' . $item['title'] . '</div>' : '';
                 $out .= '<div class="position">Position</div>';
                 $out .= '<div class="text">';
                 $out .= isset($item['content']) && !empty($item['content']) ? $item['content'] : '';
                 $out .= '</div>';
                 $out .= '</div>';
                 $out .= '</div>';
             }
         }
         $out .= '<a href="/?post_type=post" class="read-all">Read all</a>';
         $out .= '</div>';
     }
     $out .= '</div><!-- /.hot_updates -->';
     $out .= '</div><!-- /.module-posts -->';
     echo $out;
     echo $after_widget;
 }
Пример #6
0
 /**
  *
  */
 public static function im_news($atts = null, $content = null)
 {
     if ($atts == 'generator') {
         return array('name' => __('News', MISS_ADMIN_TEXTDOMAIN), 'base' => 'im_news', 'icon' => 'im-icon-newspaper', 'category' => __('Theme Short-Codes', MISS_ADMIN_TEXTDOMAIN), 'params' => array(array('heading' => __('Caption', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Enter news block title.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'caption', 'type' => 'textfield', 'value' => ''), array('heading' => __('Tagline', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Enter news block tagline.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'tagline', 'type' => 'textfield', 'value' => ''), array('heading' => __('Number of Posts', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Select the number of posts you wish to have displayed on each page.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'showposts', 'min' => 1, 'value' => 5, 'max' => 40, 'step' => 1, 'unit' => __('posts', MISS_ADMIN_TEXTDOMAIN), 'type' => 'range'), array('heading' => __('Offset Posts <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('This will skip a number of posts at the beginning.<br /><br />Useful if you are using multiple blog shortcodes on the same page.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'offset', 'min' => 0, 'value' => 0, 'max' => 40, 'step' => 1, 'unit' => __('posts', MISS_ADMIN_TEXTDOMAIN), 'type' => 'range'), array('heading' => __('Disable Post Elements <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('You can hide certain elements from displaying here.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'disable', 'type' => 'checkbox', 'value' => array(__('Disable Post Image', MISS_ADMIN_TEXTDOMAIN) => 'image', __('Disable Post Title', MISS_ADMIN_TEXTDOMAIN) => 'title', __('Disable Post Content', MISS_ADMIN_TEXTDOMAIN) => 'content', __('Disable Post Meta', MISS_ADMIN_TEXTDOMAIN) => 'meta', __('Disable Read More', MISS_ADMIN_TEXTDOMAIN) => 'more')), array("type" => "dropdown", "heading" => __("Viewport Animation", "js_composer"), "param_name" => "animation", "value" => miss_js_composer_css_animation(), "description" => __("Viewport animation will be triggered when this element is being viewed when you scroll page down. you only need to choose the animation style from this option. please note that this only works in moderns. We have disabled this feature in touch devices to increase browsing speed.", "js_composer"))));
     }
     $atts = shortcode_atts(array('class' => 'claen', 'caption' => '', 'tagline' => '', 'thumb' => '', 'showposts' => '', 'offset' => '', 'post_content' => '', 'type' => 'news_list', 'categories' => '', 'pagination' => '', 'disable' => '', 'caption' => '', 'tagline' => '', 'post_in' => '', 'category_in' => '', 'tag_in' => '', 'animation' => ''), $atts);
     extract($atts);
     if ($animation != '') {
         $animation = ' im-animate-element ' . $animation . ' ';
     }
     global $post, $wp_rewrite, $wp_query, $irish_framework_params;
     $out = '';
     $showposts = trim($showposts);
     $column = !empty($column) ? trim($column) : '4';
     $thumb = !empty($thumb) ? trim($thumb) : 'small';
     $offset = isset($offset) ? trim($offset) : '';
     $post_in = !empty($post_in) ? explode(",", trim($post_in)) : '';
     $category_in = !empty($category_in) ? explode(",", trim($category_in)) : '';
     $tag_in = !empty($tag_in) ? explode(",", trim($tag_in)) : '';
     if (is_front_page()) {
         $_layout = miss_get_setting('homepage_layout');
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $post_obj = $wp_query->get_queried_object();
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' || $template == 'templates/template-wiki.php' ? 'small_sidebar_images' : 'big_sidebar_images');
     }
     $post_img = '';
     $news_query = new WP_Query();
     if (trim($pagination) == 'true') {
         $paged = miss_get_page_query();
         $news_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'news', 'posts_per_page' => $showposts, 'paged' => $paged, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     } else {
         $news_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'news', 'showposts' => $showposts, 'nopaging' => 0, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     }
     if ($news_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout[$images];
         $width = '';
         $height = '';
         if ($atts['type'] == 'news_grid') {
             $column = $column > 0 || $column < 4 ? $column : 4;
             switch ($column) {
                 case 2:
                     $main_class = 'grid two_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span6 column';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout3'][0];
                     $height = $img_sizes['blog_layout3'][1];
                     break;
                 case 3:
                     $main_class = 'grid three_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span4 column';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout4'][0];
                     $height = $img_sizes['blog_layout4'][1];
                     break;
                 case 4:
                     $main_class = 'grid four_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span3 column';
                     $excerpt_lenth = 115;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 default:
                     $main_class = 'grid four_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span3 column';
                     $excerpt_lenth = 115;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
             }
         } else {
             if ($atts['type'] == 'news_list') {
                 switch ($thumb) {
                     case 'small':
                         $main_class = 'list small_post_list';
                         $post_class = 'post_list_module';
                         $content_class = 'content';
                         $img_class = 'image';
                         $excerpt_lenth = 180;
                         $width = $img_sizes['small_post_list'][0];
                         $height = $img_sizes['small_post_list'][1];
                         break;
                     default:
                         $main_class = 'list small_post_list';
                         $post_class = 'post_list_module';
                         $content_class = 'content';
                         $img_class = 'image';
                         $excerpt_lenth = 180;
                         $width = $img_sizes['small_post_list'][0];
                         $height = $img_sizes['small_post_list'][1];
                         break;
                 }
             }
         }
         if ($caption != '') {
             $out .= '					<div class="blog_header">';
             $out .= '						<h4 class="pull-left caption">';
             $out .= '							' . $caption;
             $out .= '						</h4>';
             $out .= '						<h6 class="pull-left tagline">';
             $out .= '							' . $tagline;
             $out .= '						</h6>';
             $out .= '						<div class="clearboth">';
             $out .= '						</div>';
             $out .= '					</div><!-- /.blog_header-->';
         }
         $filter_args = array('width' => $width, 'height' => $height, 'img_class' => $img_class, 'link_class' => 'blog_sc_image_load', 'preload' => true, 'post_content' => $post_content, 'disable' => $disable, 'column' => $column, 'thumb' => $thumb, 'type' => $atts['type'], 'shortcode' => true, 'echo' => false);
         $out .= $atts['type'] == 'news_grid' ? '<div class="sc_layout ' . $main_class . '"><div class="row-fluid">' : '<ul class="blogging ' . $main_class . '">';
         $spans_in_row = $column;
         $span_walk = 0;
         $row_walk = 1;
         while ($news_query->have_posts()) {
             $news_query->the_post();
             $out .= $atts['type'] == 'news_grid' ? '<div class="' . $column_class . ' im-transform im-animate-element fade-in">' : '<li class="' . join(' ', get_post_class($post_class, get_the_ID())) . '">';
             if ($atts['type'] == 'news_list') {
                 $out .= '<div class="month pull-left">';
                 $out .= '<span class="day">';
                 $out .= '<span>';
                 $out .= get_the_date('M');
                 $out .= '</span>';
                 $out .= get_the_date('d');
                 $out .= '</span>';
                 $out .= '</div>';
                 $filter_args['disable'] .= 'image';
             }
             $out .= miss_before_post_sc($filter_args);
             $out .= '<div class="' . $content_class . '">';
             if (strpos($disable, 'content') === false) {
                 $out .= '<div class="post_excerpt">';
                 $out .= miss_excerpt(get_the_excerpt(), $excerpt_lenth, THEME_ELLIPSIS);
                 if (!empty($disable) && strpos($disable, 'more') === false || empty($disable)) {
                     $out .= miss_full_read_more();
                 }
                 $out .= '</div><!-- /.post_excerpt -->';
             }
             $out .= '</div><!-- /.content -->';
             $out .= $atts['type'] == 'news_grid' ? '</div>' : '</li>';
         }
         //while
         $out .= $atts['type'] == 'news_grid' ? '</div></div>' : '</ul>';
     }
     //if
     wp_reset_query();
     return '<div class="sc-news ' . $class . $animation . '">' . $out . '</div>';
 }
Пример #7
0
        $query->the_post();
        $sid = get_the_id();
        $link = get_permalink($sid);
        $column_count++;
        $column_class = 'span3';
        $column_class .= $column_count == 4 || $column_count == 3 && $spotlight['layout'] == 'left_sidebar' ? ' last' : '';
        echo '<div class="' . $column_class . '">';
        echo '<div class="entry has_preview">';
        if (has_post_thumbnail()) {
            $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium');
            $thumb = miss_wp_image($thumb[0], 518, 338);
            echo '<div class="post-thumbnail"><a href="' . get_permalink() . '" title="' . get_the_title() . '" class="pic"><img src="' . $thumb . '" class="image-resize w" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a></div>';
        }
        echo '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
        echo '<div class="date">' . get_the_time('l, M j Y') . '</div>';
        echo '<p>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', $spotlight['excerpt']['content']), apply_filters('miss_home_spotlight_excerpt', THEME_ELLIPSIS)) . '</p>';
        if ($spotlight["readmore"]["enable"] == true) {
            $readmore_caption = $spotlight['readmore']['label'] ? $spotlight['readmore']['label'] : __('Read More', MISS_TEXTDOMAIN);
            echo '<p class="read_more_block"><a class="post_more_link" href="' . esc_url($link) . '">' . $readmore_caption . '</a></p>';
        }
        echo '</div>';
        echo '</div>';
    }
    if ($spotlight['layout'] == 'right_sidebar') {
        echo '<div class="span3 last">';
        echo miss_render_subblock($opt, $spotlight['subblock']);
        echo '</div>';
    }
    echo '</div>';
    echo '<div class="clearfix"></div>';
}
Пример #8
0
 function _staff_shortcode($args = array())
 {
     global $post, $wp_rewrite, $wp_query, $irish_framework_params;
     extract($args['atts']);
     $out = '';
     $showposts = trim($showposts);
     $column = !empty($column) ? trim($column) : '3';
     $thumb = !empty($thumb) ? trim($thumb) : 'medium';
     $offset = isset($offset) ? trim($offset) : '';
     $post_in = !empty($post_in) ? explode(",", trim($post_in)) : '';
     $category_in = !empty($category_in) ? explode(",", trim($category_in)) : '';
     $tag_in = !empty($tag_in) ? explode(",", trim($tag_in)) : '';
     if (is_front_page()) {
         $_layout = miss_get_setting('homepage_layout');
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $post_obj = $wp_query->get_queried_object();
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' || $template == 'templates/template-wiki.php' ? 'small_sidebar_images' : 'big_sidebar_images');
     }
     $post_img = '';
     $staff_query = new WP_Query();
     if (trim($pagination) == 'true') {
         $paged = miss_get_page_query();
         $staff_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'staff', 'posts_per_page' => $showposts, 'paged' => $paged, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     } else {
         $staff_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'staff', 'showposts' => $showposts, 'nopaging' => 0, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     }
     if ($staff_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout[$images];
         $width = '';
         $height = '';
         if ($args['type'] == 'staff_grid') {
             $column = $column > 0 || $column < 4 ? $column : 4;
             switch ($column) {
                 case 1:
                     $main_class = 'grid one_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $excerpt_lenth = 400;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 case 2:
                     $main_class = 'grid two_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span6';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 case 3:
                     $main_class = 'grid three_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span4';
                     $excerpt_lenth = 75;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 case 4:
                     $main_class = 'grid four_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span3';
                     $excerpt_lenth = 10;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 default:
                     $main_class = 'grid four_column staff';
                     $post_class = 'post_grid_module';
                     $content_class = 'post_grid_content';
                     $img_class = 'image';
                     $column_class = 'span3';
                     $excerpt_lenth = 10;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
             }
         }
         if ($caption != '') {
             $out .= '					<div class="blog_header">';
             $out .= '						<h4 class="pull-left caption">';
             $out .= '							' . $caption;
             $out .= '						</h4>';
             $out .= '						<h6 class="pull-left tagline">';
             $out .= '							' . $tagline;
             $out .= '						</h6>';
             $out .= '						<div class="clearboth">';
             $out .= '						</div>';
             $out .= '					</div><!-- /.blog_header-->';
         }
         $filter_args = array('width' => $width, 'height' => $height, 'img_class' => $img_class, 'link_class' => 'staff_sc_image_load', 'preload' => true, 'no_link' => true, 'post_content' => $post_content, 'disable' => $disable, 'column' => $column, 'thumb' => $thumb, 'type' => $args['type'], 'shortcode' => true, 'echo' => false);
         $out .= $args['type'] == 'staff_grid' ? '<div class="sc_layout ' . $main_class . '"><div class="row-fluid">' : '<ul class="' . $main_class . '">';
         $spans_in_row = $column;
         $span_walk = 0;
         $row_walk = 1;
         while ($staff_query->have_posts()) {
             $staff_query->the_post();
             if ($spans_in_row * $row_walk == $span_walk) {
                 $out .= '</div><!-- /.row-fluid --> <div class="row-fluid">';
             } else {
                 $out .= '';
             }
             if ($spans_in_row * $row_walk == $span_walk) {
                 $row_walk++;
             }
             $span_walk++;
             if (!empty($animation)) {
                 $animation = ' im-transform im-animate-element ' . $animation;
             }
             $out .= $args['type'] == 'staff_list' ? '' : ($column != 1 ? '<div class="' . $column_class . $animation . '">' : '');
             $out .= $args['type'] == 'staff_grid' ? '<div class="' . join(' ', get_post_class($post_class, get_the_ID())) . '">' : '<li class="' . join(' ', get_post_class($post_class, get_the_ID())) . '">';
             if (in_array('post_list_image', $filter_args)) {
                 $filter_args = array_merge($filter_args, array('inline_width' => true));
             }
             if (strpos($filter_args['disable'], 'image') === false) {
                 //				$image = miss_get_post_image( $filter_args );
                 //				$out .= str_replace( array( '<a', '</a' ), array( '<span', '</span' ), $image) ;
                 $out .= miss_get_post_image($filter_args);
             }
             if (strpos($filter_args['disable'], 'title') === false) {
                 $out .= $title = the_title('<h2 class="post_title">', '</h2>', false);
             }
             if (strpos($filter_args['disable'], 'meta') === false) {
                 $out .= miss_post_meta_diferent($filter_args);
             }
             $out .= '<div class="employee_position">' . get_post_meta(get_the_id(), 'position', true) . '</div>';
             $out .= '<div class="' . $content_class . '">';
             $out .= '<div class="post_excerpt">';
             if (strpos($disable, 'content') === false) {
                 $out .= miss_excerpt(get_the_excerpt(), 115, THEME_ELLIPSIS);
                 if (!empty($disable) && strpos($disable, 'more') === false || empty($disable)) {
                     $out .= miss_full_read_more();
                 }
             }
             $out .= '</div>';
             //		$out .= miss_after_entry_sc( $filter_args );
             $sociable_pages = get_post_meta(get_the_id(), 'sociable');
             foreach ($sociable_pages[0] as $key => $value) {
                 //$out .= $key ;
                 if ($key != '#' and $key != 'keys') {
                     $out .= '<a class="sociable_icon" href="' . $value['link'] . '"><i class="fs-icon-' . $value['icon'] . '"></i></a>';
                 }
             }
             $out .= '<div class="clearboth"></div>';
             $out .= '</div><!-- .post_class -->';
             $out .= $args['type'] == 'staff_grid' ? '</div>' : '</li>';
             $out .= $args['type'] == 'staff_list' ? '' : ($column != 1 ? '</div>' : '');
         }
         $out .= $args['type'] == 'staff_grid' ? '</div></div>' : '</ul>';
         if ($pagination == 'true') {
             $out .= miss_pagenavi('', '', $staff_query);
         }
     }
     wp_reset_query();
     return $out;
 }
Пример #9
0
 /**
  *
  */
 public static function im_posttypelayout($atts, $content = null, $code = null)
 {
     $posttypes = array(__('Posts', MISS_ADMIN_TEXTDOMAIN) => 'post', __('News', MISS_ADMIN_TEXTDOMAIN) => 'news', __('Portfolio', MISS_ADMIN_TEXTDOMAIN) => 'portfolio', __('Staff', MISS_ADMIN_TEXTDOMAIN) => 'staff', __('Testimonials', MISS_ADMIN_TEXTDOMAIN) => 'testimonials', __('Services', MISS_ADMIN_TEXTDOMAIN) => 'service');
     $classes = array(__('Grid', MISS_ADMIN_TEXTDOMAIN) => 'grid', __('Comments Slider', MISS_ADMIN_TEXTDOMAIN) => 'comslider', __('List', MISS_ADMIN_TEXTDOMAIN) => 'list', __('more-links', MISS_ADMIN_TEXTDOMAIN) => 'more-links', __('Portfolio small', MISS_ADMIN_TEXTDOMAIN) => 'portfolio-small', __('Portfolio fullwidth', MISS_ADMIN_TEXTDOMAIN) => 'portfolio-fullwidth', __('Portfolio two columns', MISS_ADMIN_TEXTDOMAIN) => 'portfolio-two', __('Portfolio three columns', MISS_ADMIN_TEXTDOMAIN) => 'portfolio-three');
     $entries = get_categories('orderby=name&hide_empty=0');
     foreach ($entries as $key => $entry) {
         $categories[$entry->name] = $entry->term_id;
     }
     $entries = get_terms('portfolio_category', 'orderby=name&hide_empty=0');
     foreach ($entries as $key => $entry) {
         $portfolio_categories[$entry->name] = $entry->slug;
     }
     if ($atts == 'generator') {
         return array('name' => __('Posts/Pages Layout', MISS_ADMIN_TEXTDOMAIN), 'base' => 'im_posttypelayout', 'icon' => 'im-icon-grid-5', 'category' => __('Theme Short-Codes', MISS_ADMIN_TEXTDOMAIN), 'params' => array(array('heading' => __('Caption <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Here you can add section title (leave blank to hide).', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'caption', 'type' => 'textfield', 'value' => ''), array('heading' => __('Tagline <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Here you can add section tagline that will appears right from section title.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'tagline', 'type' => 'textfield', 'value' => ''), array('heading' => __('Post types', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Select post types to populate items from.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'posttype', 'type' => 'dropdown', 'value' => $posttypes), array('heading' => __('Layout Type', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Select layout type.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'class', 'type' => 'dropdown', 'value' => $classes), array('heading' => __('Number of Columns', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Set number of columns in a row.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'column', 'min' => 1, 'max' => 4, 'step' => 1, 'unit' => __('columns', MISS_ADMIN_TEXTDOMAIN), 'type' => 'range', 'dependency' => array('element' => 'class', 'value' => array('grid', 'comslider'))), array('heading' => __('Number of Posts', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Select the number of posts you wish to have displayed on each page.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'showposts', 'min' => 1, 'value' => 5, 'max' => 40, 'step' => 1, 'unit' => __('posts', MISS_ADMIN_TEXTDOMAIN), 'type' => 'range'), array('heading' => __('Offset Posts <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('This will skip a number of posts at the beginning.<br /><br />Useful if you are using multiple blog shortcodes on the same page.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'offset', 'min' => 0, 'value' => 0, 'max' => 40, 'step' => 1, 'unit' => __('posts', MISS_ADMIN_TEXTDOMAIN), 'type' => 'range'), array('heading' => __('Disable Post Elements <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('You can hide certain elements from displaying here.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'disable', 'type' => 'checkbox', 'value' => array(__('Disable Post Image', MISS_ADMIN_TEXTDOMAIN) => 'image', __('Disable Post Title', MISS_ADMIN_TEXTDOMAIN) => 'title', __('Disable Post Content', MISS_ADMIN_TEXTDOMAIN) => 'content', __('Disable Post Meta', MISS_ADMIN_TEXTDOMAIN) => 'meta', __('Disable Read More', MISS_ADMIN_TEXTDOMAIN) => 'more')), array('heading' => __('Posts Categories', MISS_ADMIN_TEXTDOMAIN), 'description' => __('By default shortcode will pushing recent posts from all categories.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'category_in', 'type' => 'checkbox', 'value' => $categories, 'dependency' => array('element' => 'posttype', 'value' => array('post'))), array('heading' => __('Portfolio Categories', MISS_ADMIN_TEXTDOMAIN), 'description' => __('By default shortcode will pushing recent work from all categories.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'portfolio_terms', 'type' => 'checkbox', 'value' => $portfolio_categories, 'dependency' => array('element' => 'posttype', 'value' => array('portfolio'))), array("type" => "dropdown", "heading" => __("Viewport Animation", MISS_ADMIN_TEXTDOMAIN), "param_name" => "animation", "value" => miss_js_composer_css_animation(), "description" => __("Viewport animation will be triggered when this element is being viewed when you scroll page down. you only need to choose the animation style from this option. please note that this only works in moderns. We have disabled this feature in touch devices to increase browsing speed.", MISS_ADMIN_TEXTDOMAIN))));
     }
     global $post, $wp_rewrite, $wp_query, $irish_framework_params;
     $defaults = array('caption' => '', 'tagline' => '', 'posttype' => 'post', 'class' => 'grid', 'column' => '', 'showposts' => '', 'offset' => '', 'disable' => '', 'category_in' => '', 'portfolio_terms' => '', 'animation' => '');
     extract(shortcode_atts($defaults, $atts));
     $out = '';
     if ($animation != '') {
         $animation = ' im-animate-element ' . $animation . ' ';
     }
     $posttype = array_search($posttype, $posttypes) != false ? $posttype : 'post';
     $class = array_search($class, $classes) != false ? $class : 'grid';
     $category_in = !empty($category_in) && $posttype == 'post' ? explode(",", trim($category_in)) : '';
     $query_args = array('post_type' => $posttype, 'showposts' => $showposts, 'category__in' => $category_in, 'offset' => $offset, 'nopaging' => 0, 'ignore_sticky_posts' => 1);
     if (!empty($portfolio_terms) && $posttype == 'portfolio') {
         $taxonomy = 'portfolio_category';
         $term = explode(",", trim($portfolio_terms)) ? explode(",", trim($portfolio_terms)) : $portfolio_terms;
         $query_args['taxonomy'] = 'portfolio_category';
         $query_args['tax_query'] = array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $term));
     } else {
         $taxonomy = '';
         $portfolio_terms = '';
     }
     if (is_front_page()) {
         $_layout = miss_get_setting('homepage_layout') ? miss_get_setting('homepage_layout') : 'full_width';
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } elseif ($wp_query->get_queried_object()) {
         $post_obj = $wp_query->get_queried_object();
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $_layout = 'full_width';
         $images = 'images';
     }
     $sc_post_query = new WP_Query();
     $sc_post_query->query($query_args);
     if ($sc_post_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout[$images];
         $width = '';
         $height = '';
         if ($class == 'list') {
             $column_class = 'span12 content-item';
             $excerpt_lenth = 180;
             $width = $img_sizes['small_post_list'][0];
             $height = $img_sizes['small_post_list'][1];
         } else {
             $column = $column > 0 || $column < 4 ? $column : 4;
             switch ($column) {
                 case 1:
                     $column_class = 'content-item span12';
                     $excerpt_lenth = 400;
                     $width = $img_sizes['blog_layout1'][0];
                     $height = $img_sizes['blog_layout1'][1];
                     break;
                 case 2:
                     $column_class = 'content-item span6';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout3'][0];
                     $height = $img_sizes['blog_layout3'][1];
                     break;
                 case 3:
                     $column_class = 'content-item span4';
                     $excerpt_lenth = 138;
                     $width = $img_sizes['blog_layout4'][0];
                     $height = $img_sizes['blog_layout4'][1];
                     break;
                 case 4:
                     $column_class = 'content-item span3';
                     $excerpt_lenth = 115;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 default:
                     $column_class = 'content-item span3';
                     $excerpt_lenth = 115;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
             }
         }
         $img_class = 'image';
         $filter_args = array('width' => $width, 'height' => $height, 'img_class' => $img_class, 'link_class' => 'sc_image_load', 'preload' => true, 'disable' => $disable, 'column' => $column, 'type' => $posttype, 'shortcode' => true, 'echo' => false);
         /*if ( $class == 'comslider') {
         			$carousel_item_start = '<li class="embedded">';
         			$carousel_item_end = '</li><!-- /.embedded -->';
         		} else {
         			$carousel_item_start = '';
         			$carousel_item_end = '';
         		}*/
         $spans_in_row = $column;
         $span_walk = 0;
         $row_walk = 1;
         /**
          * Возвращение контента в зависимости от класса
          * 
          * */
         $out_caption = '';
         if ($caption != '') {
             $out_caption = '<header class="section-header span12">
                           <h1 class="header">
                             <span>' . $caption . '</span>
                           </h1>';
             if ($tagline != '') {
                 $out_caption .= '<h3 class="header">' . $tagline . '</h3>';
             }
             $out_caption .= '</header>';
         }
         if ($class == 'grid') {
             $row_delimeter = '</div><!-- /.inner-wrapp --><div class="inner-wrapp">';
             $out .= '<div class="inner-wrapp">';
             while ($sc_post_query->have_posts()) {
                 if ($spans_in_row * $row_walk == $span_walk) {
                     $out .= $row_delimeter;
                 }
                 if ($spans_in_row * $row_walk == $span_walk) {
                     $row_walk++;
                 }
                 $span_walk++;
                 $sc_post_query->the_post();
                 $out .= '<section class="' . $column_class . $animation . '">';
                 $out .= '   <header class="header">';
                 $out .= miss_post_icon($filter_args);
                 $out .= miss_post_title($filter_args);
                 $out .= '   </header>';
                 $out .= '   <article class="article">';
                 if (strpos($disable, 'content') === false) {
                     $out .= '<p>' . miss_excerpt(get_the_excerpt(), $excerpt_lenth, THEME_ELLIPSIS) . '</p>';
                     // описание
                 }
                 $out .= '   </article><!-- /.content -->';
                 $out .= miss_full_read_more();
                 $out .= '</section><!-- /.' . $column_class . ' -->';
             }
             $out .= '</div><!-- /.row-fluid -->';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . '">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'list') {
             $filter_args['wraptitle'] = false;
             $row_delimeter = '</div><!-- /.inner-wrapp --><div class="inner-wrapp">';
             $out .= '<div class="inner-wrapp">';
             while ($sc_post_query->have_posts()) {
                 if ($spans_in_row * $row_walk == $span_walk) {
                     $out .= $row_delimeter;
                 }
                 if ($spans_in_row * $row_walk == $span_walk) {
                     $row_walk++;
                 }
                 $span_walk++;
                 $sc_post_query->the_post();
                 $filter_args['get_src'] = true;
                 $filter_args['width'] = 300;
                 $filter_args['height'] = 220;
                 //print_r($filter_args);
                 $out .= '<section class="content-item span4 hover-slide-effect ' . $animation . '">';
                 $out .= '<div class="preview" data-src="' . miss_get_post_image($filter_args) . '" style="background-image: url(' . miss_get_post_image($filter_args) . ');"></div>';
                 $out .= '<div class="desc">
                       <header class="header">
                         <h4>' . miss_post_title($filter_args) . '</h4>
                       </header>';
                 $out .= '<article class="article">';
                 $out .= '<p>' . miss_excerpt(get_the_excerpt(), $excerpt_lenth, THEME_ELLIPSIS) . '</p>';
                 // описание
                 $out .= '</article><!-- /.content -->';
                 $out .= '<a href="' . esc_url(get_permalink()) . '" class="btn ribbon-style smallest-ribbon">View details</a>';
                 $out .= '</div></section>';
             }
             $out .= '</div><!-- /.inner-wrapp -->';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . '">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'more-links') {
             $out .= '<div class="span12 ' . $class . ' ' . $posttype . '">';
             while ($sc_post_query->have_posts()) {
                 $sc_post_query->the_post();
                 $out .= '<a class="nav-item" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(the_title_attribute('echo=0')) . '">' . miss_excerpt(the_title('', '', false), 30, THEME_ELLIPSIS) . '</a>';
             }
             $out .= '</div><!-- /.inner-wrapp -->';
             $out = '<div class="row sc_layout">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'comslider') {
             $out .= '<div class="flex_slideshow_container arrows_top span12">
         			<div class="flexslider text-slider">
                     <div class="additional-layer left-layer">
                         <div class="triangle top left"></div>
                         <div class="triangle bottom left"></div>
                     </div>
         			<ul class="slides">';
             while ($sc_post_query->have_posts()) {
                 $sc_post_query->the_post();
                 $out .= '<li>
                         <div class="testimonial">
                             <div class="descr"><span class="quot ql"></span>' . miss_excerpt(get_the_excerpt(), 90, THEME_ELLIPSIS) . '<span class="quot qr"></span></div> 
                             <div class="name">' . miss_excerpt(the_title('', '', false), 30, THEME_ELLIPSIS) . '</div>
                             <div class="caption">' . get_post_meta(get_the_ID(), 'testimonial_caption', true) . '</div>
                         </div>
                     </li>';
             }
             $out .= '</ul>
                     <div class="additional-layer right-layer">
                         <div class="triangle top right"></div>
                         <div class="triangle bottom right"></div>
                     </div>
         			</div>
     			</div>';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . '">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'portfolio-small') {
             $out .= '<div class="inner-wrapp span12"><div class="row gallery">';
             $filter_args['width'] = $filter_args['height'] = 220;
             while ($sc_post_query->have_posts()) {
                 $sc_post_query->the_post();
                 $out .= '<div class="content-item span3 ' . $animation . '">
                           <div class="preview-container preview-small base-preview">
                             <div class="preview-image">
                               ' . miss_get_post_image($filter_args) . '
                             </div>
                             <div class="preview-info-wrapper">
                               <div class="controls">
                                 <a href="' . esc_url(get_permalink()) . '" class="control zoom"><i class="marker im-icon-zoom-in"></i></a>
                               </div>
                             </div>
                           </div>
                         </div>';
             }
             $out .= '</div></div>';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . ' works">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'portfolio-fullwidth') {
             $filter_args['width'] = 940;
             $filter_args['height'] = 587;
             $out .= '<div class="inner-wrapp span12 works"><div class="row gallery">';
             while ($sc_post_query->have_posts()) {
                 $sc_post_query->the_post();
                 $out .= '<div class="content-item span12 ' . $animation . '">
                           <div class="preview-container preview-largest base-preview">
                             <div class="preview-image">
                               ' . miss_get_post_image($filter_args) . '
                             </div>
                             <div class="preview-info-wrapper">
                               <div class="controls">
                                 <a href="' . esc_url(get_permalink()) . '" class="control zoom"><i class="marker im-icon-zoom-in"></i></a>
                               </div>
                             </div>
                           </div>
                         </div>';
                 //print_r($filter_args);
             }
             $out .= '</div></div>';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . '">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'portfolio-two') {
             $filter_args['width'] = 460;
             $filter_args['height'] = 300;
             $out .= '<div class="inner-wrapp span12 gallery"><div class="row">';
             while ($sc_post_query->have_posts()) {
                 $sc_post_query->the_post();
                 $out .= '<div class="content-item span6 ' . $animation . '">
                           <div class="preview-container preview-large base-preview">
                             <div class="preview-image">
                               ' . miss_get_post_image($filter_args) . '
                             </div>
                             <div class="preview-info-wrapper">
                               <div class="controls">
                                 <a href="' . esc_url(get_permalink()) . '" class="control zoom"><i class="marker im-icon-zoom-in"></i></a>
                               </div>
                             </div>
                           </div>
                         </div>';
                 //print_r($filter_args);
             }
             $out .= '</div></div>';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . '">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         } elseif ($class == 'portfolio-three') {
             $filter_args['width'] = 300;
             $filter_args['height'] = 300;
             $out .= '<div class="inner-wrapp span12 gallery"><div class="row">';
             while ($sc_post_query->have_posts()) {
                 $sc_post_query->the_post();
                 $out .= '<div class="content-item span4 ' . $animation . '">
                           <div class="preview-container preview-normal base-preview">
                             <div class="preview-image">
                               ' . miss_get_post_image($filter_args) . '
                             </div>
                             <div class="preview-info-wrapper">
                               <div class="controls">
                                 <a href="' . esc_url(get_permalink()) . '" class="control zoom"><i class="marker im-icon-zoom-in"></i></a>
                               </div>
                             </div>
                           </div>
                         </div>';
                 //print_r($filter_args);
             }
             $out .= '</div></div>';
             $out = '<div class="row sc_layout ' . $class . ' ' . $posttype . '">' . $out_caption . $out . '</div><!-- /.sc_layout ' . $class . '-->';
         }
     }
     return $out;
 }
Пример #10
0
 function _news_shortcode($args = array())
 {
     global $post, $wp_rewrite, $wp_query, $irish_framework_params;
     extract($args['atts']);
     $out = '';
     $showposts = trim($showposts);
     $column = !empty($column) ? trim($column) : '4';
     $thumb = !empty($thumb) ? trim($thumb) : 'small';
     $offset = isset($offset) ? trim($offset) : '';
     $post_in = !empty($post_in) ? explode(",", trim($post_in)) : '';
     $category_in = !empty($category_in) ? explode(",", trim($category_in)) : '';
     $tag_in = !empty($tag_in) ? explode(",", trim($tag_in)) : '';
     if (is_front_page()) {
         $_layout = miss_get_setting('homepage_layout');
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $post_obj = $wp_query->get_queried_object();
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' || $template == 'templates/template-wiki.php' ? 'small_sidebar_images' : 'big_sidebar_images');
     }
     $post_img = '';
     $news_query = new WP_Query();
     if (trim($pagination) == 'true') {
         $paged = miss_get_page_query();
         $news_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'news', 'posts_per_page' => $showposts, 'paged' => $paged, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     } else {
         $news_query->query(array('post__in' => $post_in, 'category__in' => $category_in, 'tag__in' => $tag_in, 'post_type' => 'news', 'showposts' => $showposts, 'nopaging' => 0, 'offset' => $offset, 'ignore_sticky_posts' => 1));
     }
     if ($news_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout[$images];
         $width = '';
         $height = '';
         if ($args['type'] == 'news_grid') {
             $column = $column > 0 || $column < 4 ? $column : 4;
             switch ($column) {
                 /*				case 1:
                 						$main_class = 'grid one_column';
                 						$post_class = 'grid_module';
                 						$content_class = 'content';
                 						$img_class = 'image';
                 						$column_class = 'span12 column';
                 						$excerpt_lenth = 400;
                 						$width = $img_sizes['blog_layout1'][0];
                 						$height = $img_sizes['blog_layout1'][1];
                 						break;
                 	*/
                 case 2:
                     $main_class = 'grid two_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span6 column';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout3'][0];
                     $height = $img_sizes['blog_layout3'][1];
                     break;
                 case 3:
                     $main_class = 'grid three_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span4 column';
                     $excerpt_lenth = 150;
                     $width = $img_sizes['blog_layout4'][0];
                     $height = $img_sizes['blog_layout4'][1];
                     break;
                 case 4:
                     $main_class = 'grid four_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span3 column';
                     $excerpt_lenth = 115;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
                 default:
                     $main_class = 'grid four_column';
                     $post_class = 'grid_module';
                     $content_class = 'content';
                     $img_class = 'image';
                     $column_class = 'span3 column';
                     $excerpt_lenth = 115;
                     $width = $img_sizes['blog_layout5'][0];
                     $height = $img_sizes['blog_layout5'][1];
                     break;
             }
         } else {
             if ($args['type'] == 'news_list') {
                 switch ($thumb) {
                     case 'small':
                         $main_class = 'list small_post_list';
                         $post_class = 'post_list_module';
                         $content_class = 'content';
                         $img_class = 'image';
                         $excerpt_lenth = 180;
                         $width = $img_sizes['small_post_list'][0];
                         $height = $img_sizes['small_post_list'][1];
                         break;
                         /*
                         						case 'medium':
                         							$main_class = 'medium_post_list';
                         							$post_class = 'post_list_module';
                         							$content_class = 'content';
                         							$img_class = 'image';
                         							$excerpt_lenth = 180;
                         							$width = $img_sizes['medium_post_list'][0];
                         							$height = $img_sizes['medium_post_list'][1];
                         							break;
                         						case 'large':
                         							$main_class = 'large_post_list';
                         							$post_class = 'post_list_module';
                         							$content_class = 'content';
                         							$img_class = 'image';
                         							$excerpt_lenth = 180;
                         							$width = $img_sizes['large_post_list'][0];
                         							$height = $img_sizes['large_post_list'][1];
                         							break;
                         */
                     /*
                     						case 'medium':
                     							$main_class = 'medium_post_list';
                     							$post_class = 'post_list_module';
                     							$content_class = 'content';
                     							$img_class = 'image';
                     							$excerpt_lenth = 180;
                     							$width = $img_sizes['medium_post_list'][0];
                     							$height = $img_sizes['medium_post_list'][1];
                     							break;
                     						case 'large':
                     							$main_class = 'large_post_list';
                     							$post_class = 'post_list_module';
                     							$content_class = 'content';
                     							$img_class = 'image';
                     							$excerpt_lenth = 180;
                     							$width = $img_sizes['large_post_list'][0];
                     							$height = $img_sizes['large_post_list'][1];
                     							break;
                     */
                     default:
                         $main_class = 'list small_post_list';
                         $post_class = 'post_list_module';
                         $content_class = 'content';
                         $img_class = 'image';
                         $excerpt_lenth = 180;
                         $width = $img_sizes['small_post_list'][0];
                         $height = $img_sizes['small_post_list'][1];
                         break;
                 }
             }
         }
         if ($caption != '') {
             $out .= '					<div class="blog_header">';
             $out .= '						<h4 class="pull-left caption">';
             $out .= '							' . $caption;
             $out .= '						</h4>';
             $out .= '						<h6 class="pull-left tagline">';
             $out .= '							' . $tagline;
             $out .= '						</h6>';
             $out .= '						<div class="clearboth">';
             $out .= '						</div>';
             $out .= '					</div><!-- /.blog_header-->';
         }
         $filter_args = array('width' => $width, 'height' => $height, 'img_class' => $img_class, 'link_class' => 'blog_sc_image_load', 'preload' => true, 'post_content' => $post_content, 'disable' => $disable, 'column' => $column, 'thumb' => $thumb, 'type' => $args['type'], 'shortcode' => true, 'echo' => false);
         $out .= $args['type'] == 'news_grid' ? '<div class="sc_layout ' . $main_class . '"><div class="row-fluid">' : '<ul class="blogging ' . $main_class . '">';
         $spans_in_row = $column;
         $span_walk = 0;
         $row_walk = 1;
         while ($news_query->have_posts()) {
             $news_query->the_post();
             if ($spans_in_row * $row_walk == $span_walk) {
                 $out .= '</div><!-- /.row-fluid --> <div class="row-fluid">';
             } else {
                 $out .= '';
             }
             if ($spans_in_row * $row_walk == $span_walk) {
                 $row_walk++;
             }
             $span_walk++;
             $out .= $args['type'] == 'news_grid' ? '<div class="' . $column_class . ' im-transform im-animate-element fade-in">' : '<li class="' . join(' ', get_post_class($post_class, get_the_ID())) . '">';
             /*
             		$out .= ( $args['type'] == 'news_list' ) ? '<div class="' . join( ' ', get_post_class( $post_class, get_the_ID() ) ) . '">' : '<li class="' . join( ' ', get_post_class( $post_class, get_the_ID() ) ) . '">';
             */
             if ($args['type'] == 'news_list') {
                 $out .= '<div class="month pull-left">';
                 $out .= '<span class="day">';
                 $out .= '<span>';
                 $out .= get_the_date('M');
                 $out .= '</span>';
                 $out .= get_the_date('d');
                 $out .= '</span>';
                 $out .= '</div>';
                 $filter_args['disable'] .= 'image';
             }
             $out .= miss_before_post_sc($filter_args);
             $out .= '<div class="' . $content_class . '">';
             if (strpos($disable, 'content') === false) {
                 $out .= '<div class="post_excerpt">';
                 $out .= miss_excerpt(get_the_excerpt(), $excerpt_lenth, THEME_ELLIPSIS);
                 if (!empty($disable) && strpos($disable, 'more') === false || empty($disable)) {
                     $out .= miss_full_read_more();
                 }
                 $out .= '</div><!-- /.post_excerpt -->';
             }
             $out .= '</div><!-- /.content -->';
             $out .= $args['type'] == 'news_grid' ? '</div>' : '</li>';
         }
         //while
         $out .= $args['type'] == 'news_grid' ? '</div></div>' : '</ul>';
     }
     //if
     wp_reset_query();
     return $out;
 }
Пример #11
0
 /**
  *
  */
 public static function im_lastpost($atts, $content = null, $code = null)
 {
     $posttypes = array(__('Posts', MISS_ADMIN_TEXTDOMAIN) => 'post', __('News', MISS_ADMIN_TEXTDOMAIN) => 'news', __('Portfolio', MISS_ADMIN_TEXTDOMAIN) => 'portfolio', __('Staff', MISS_ADMIN_TEXTDOMAIN) => 'staff', __('Testimonials', MISS_ADMIN_TEXTDOMAIN) => 'testimonials', __('Services', MISS_ADMIN_TEXTDOMAIN) => 'services');
     $entries = get_categories('orderby=name&hide_empty=0');
     foreach ($entries as $key => $entry) {
         $categories[$entry->name] = $entry->term_id;
     }
     $entries = get_terms('portfolio_category', 'orderby=name&hide_empty=0');
     foreach ($entries as $key => $entry) {
         $portfolio_categories[$entry->name] = $entry->slug;
     }
     if ($atts == 'generator') {
         return array('name' => __('Last posts Layout', MISS_ADMIN_TEXTDOMAIN), 'base' => 'im_lastpost', 'icon' => 'im-icon-grid-5', 'category' => __('Theme Short-Codes', MISS_ADMIN_TEXTDOMAIN), 'params' => array(array('heading' => __('Caption <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Here you can add section title (leave blank to hide).', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'caption', 'type' => 'textfield', 'value' => ''), array('heading' => __('Post types', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Select post types to populate items from.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'posttype', 'type' => 'dropdown', 'value' => $posttypes), array('heading' => __('Number of Posts', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Select the number of posts you wish to have displayed on each page.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'showposts', 'min' => 1, 'value' => 5, 'max' => 40, 'step' => 1, 'unit' => __('posts', MISS_ADMIN_TEXTDOMAIN), 'type' => 'range'), array('heading' => __('Posts Categories', MISS_ADMIN_TEXTDOMAIN), 'description' => __('By default shortcode will pushing recent posts from all categories.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'category_in', 'type' => 'checkbox', 'value' => $categories, 'dependency' => array('element' => 'posttype', 'value' => array('post'))), array("type" => "dropdown", "heading" => __("Viewport Animation", MISS_ADMIN_TEXTDOMAIN), "param_name" => "animation", "value" => miss_js_composer_css_animation(), "description" => __("Viewport animation will be triggered when this element is being viewed when you scroll page down. you only need to choose the animation style from this option. please note that this only works in moderns. We have disabled this feature in touch devices to increase browsing speed.", MISS_ADMIN_TEXTDOMAIN))));
     }
     global $post, $wp_rewrite, $wp_query, $irish_framework_params;
     $defaults = array('caption' => '', 'posttype' => 'post', 'showposts' => '', 'category_in' => '', 'animation' => '');
     extract(shortcode_atts($defaults, $atts));
     $out = '';
     if ($animation != '') {
         $animation = ' im-animate-element ' . $animation . ' ';
     }
     $posttype = array_search($posttype, $posttypes) != false ? $posttype : 'post';
     $category_in = !empty($category_in) && $posttype == 'post' ? explode(",", trim($category_in)) : '';
     $offset = $showposts;
     $query_args = array('post_type' => $posttype, 'showposts' => $offset, 'category__in' => $category_in, 'nopaging' => 0, 'ignore_sticky_posts' => 1, 'orderby' => 'post_date', 'order' => 'DESC');
     if (is_front_page()) {
         $_layout = miss_get_setting('homepage_layout') ? miss_get_setting('homepage_layout') : 'full_width';
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } elseif ($wp_query->get_queried_object()) {
         $post_obj = $wp_query->get_queried_object();
         $_layout = get_post_meta($post_obj->ID, '_layout', true);
         $template = get_post_meta($post_obj->ID, '_wp_page_template', true);
         $images = $_layout == 'full_width' ? 'images' : ($_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images');
     } else {
         $_layout = 'full_width';
         $images = 'images';
     }
     $sc_post_query = new WP_Query();
     $sc_post_query->query($query_args);
     if ($sc_post_query->have_posts()) {
         $img_sizes = $irish_framework_params->layout[$images];
         $width = '';
         $height = '';
         $img_class = 'image';
         $filter_args = array('width' => 220, 'height' => 220, 'img_class' => $img_class, 'link_class' => 'sc_image_load', 'preload' => true, 'disable' => $disable, 'column' => $column, 'type' => $posttype, 'shortcode' => true, 'echo' => false, 'wraptitle' => false);
         $out_caption = '';
         if ($caption != '') {
             $out_caption = '<header class="section-header span12">
                           <h1 class="header">
                             <span>' . $caption . '</span>
                           </h1>';
             if ($tagline != '') {
                 $out_caption .= '<h3 class="header">' . $tagline . '</h3>';
             }
             $out_caption .= '</header>';
         }
         $rand = rand(1000, 9999);
         $excerpt_lenth = 150;
         $row_delimeter = '</div><!-- /.inner-wrapp --> ' . $carousel_item_end . $carousel_item_start . '<div class="inner-wrapp">';
         $out .= '<div class="inner-wrapp" id="lposts' . $rand . '">';
         $i = 1;
         while ($sc_post_query->have_posts()) {
             $sc_post_query->the_post();
             $out .= '<div class="span3 content-item">';
             if ($i % 2 == 1) {
                 $out .= '<div class="preview-container preview-small extended-preview">
                             <div class="preview-image">
                               ' . miss_get_post_image($filter_args) . '
                             </div>
                             <div class="preview-info-wrapper">
                               <div class="controls">
                                 <!--a href="#" class="control zoom"><i class="marker im-icon-zoom-in"></i></a-->
                                 <a title="" href="' . miss_get_post_image(array('width' => 'auto', 'height' => 'auto', 'get_src' => true, 'echo' => false)) . '" class="control zoom" rel="prettyPhoto[' . get_post_type() . '_' . get_the_ID() . ']"><i class="marker im-icon-zoom-in"></i></a>
                                 <a href="' . esc_url(get_permalink()) . '" class="control link"><i class="marker im-icon-link"></i></a>
                               </div>
                             </div>
                           </div>';
             }
             $out .= '<div class="content">';
             $out .= '<h4 class="header">' . miss_post_title($filter_args) . '</h4>
                     <div class="article-info">
                       <div class="published">On <span class="date">' . get_the_date() . '</span></div>';
             $out .= '<div class="comments"><i class="marker im-icon-bubble-10"></i>';
             $num_comments = get_comments_number();
             // возвратит число
             if (comments_open()) {
                 if ($num_comments == 0) {
                     $comments = __('No Comments');
                 } elseif ($num_comments > 1) {
                     $comments = $num_comments . __(' Comments');
                 } else {
                     $comments = __('1 Comment');
                 }
                 $out .= '<a class="caption" href="' . get_comments_link() . '">' . $comments . '</a>';
             } else {
                 $out .= __('Comments are off for this post.');
             }
             $out .= '</div>
                     </div>';
             if ($i % 2 != 1) {
                 $out .= '<div class="article">
                           <p>' . miss_excerpt(get_the_excerpt(), $excerpt_lenth, THEME_ELLIPSIS) . '</p>
                         </div>';
             }
             $out .= '<a href="' . esc_url(get_permalink()) . '" class="btn ribbon-style smallest-ribbon">View details</a>';
             $out .= '</div>';
             $out .= '</div>';
             $i++;
         }
         $out .= '</div><!-- /.row-fluid -->';
         $button_more = '<div class="more-posts span12 big-ribbon-style" onclick="get_lastpost_ajax(lpost_posttype, lpost_limit, lpost_offset, lpost_catin);">
                           <div class="wrapper">
                             <div class="additional-wrapper">
                               <div class="remaining"></div>
                               <div class="title">
                                 <span>Show more posts</span>
                               </div>
                             </div>
                           </div>
                         </div>';
         $script = '<script>
                     var lpost_posttype = "' . $posttype . '";
                     var lpost_limit = "' . $offset . '";
                     var lpost_offset = "' . $offset . '";
                     var lpost_catin = "' . implode(',', $category_in) . '";
                     var lpost_id = "lposts' . $rand . '";
                  </script>';
         $out = $script . '<div class="row sc_layout last-posts ' . $class . ' ' . $posttype . '">' . $out_caption . $out . $button_more . '</div><!-- /.sc_layout ' . $class . '-->';
     }
     return $out;
 }
Пример #12
0
 /**
  *
  */
 function miss_category_slider()
 {
     global $post, $wpdb;
     $slider_settings = array();
     $counter = 0;
     $slider_showcats = 0;
     $slider_count = 4;
     $slider_cats = miss_get_setting('slider_cats');
     $slider_cat_count = miss_get_setting('slider_cat_count');
     $_len_title = miss_get_setting('flex_info_title_len');
     $_len_descr = miss_get_setting('flex_info_descr_len');
     if (strlen($_len_descr) == 0) {
         $_len_descr = 120;
     }
     if (strlen($_len_title) == 0) {
         $_len_title = 120;
     }
     if ($slider_cats) {
         $slider_showcats = join(',', $slider_cats);
     }
     $slider_keys = array();
     $slider_count = is_numeric($slider_cat_count) ? $slider_cat_count : 5;
     $cat_slider_query = new WP_Query("cat={$slider_showcats}&showposts={$slider_count}");
     if ($cat_slider_query->have_posts()) {
         while ($cat_slider_query->have_posts()) {
             $cat_slider_query->the_post();
             $_homepage_image = get_post_meta($post->ID, '_homepage_image', true);
             $_homepage_slider_stage = get_post_meta($post->ID, '_homepage_slider_stage', true);
             $_homepage_disable_excerpt = get_post_meta($post->ID, '_homepage_disable_excerpt', true);
             $_homepage_link = get_permalink($post->ID);
             if (!$_homepage_image) {
                 $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'single-post-thumbnail');
                 $_homepage_image = $thumb[0];
             }
             //echo $_homepage_image. '<br/>' ;
             $_homepage_image = miss_wp_image($_homepage_image, 720, 480);
             if ($_homepage_image || $_homepage_slider_stage == 'raw_html') {
                 $slider_settings[$counter]['slider_url'] = esc_url($_homepage_image);
                 $slider_settings[$counter]['alt_attr'] = esc_attr(get_the_title());
                 $slider_settings[$counter]['stage_effect'] = !empty($_homepage_slider_stage) ? $_homepage_slider_stage : 'staged_slide';
                 $slider_settings[$counter]['link_url'] = esc_url(get_permalink());
                 $slider_keys = array_merge($slider_keys, array((int) $counter));
                 if (!$_homepage_disable_excerpt && $_homepage_slider_stage != 'raw_html') {
                     $slider_settings[$counter]['description'] = miss_excerpt(get_the_excerpt(), apply_filters('miss_cat_slider_excerpt_length', $_len_descr), apply_filters('miss_cat_slider_excerpt_ellipsis', ' ... '));
                     $slider_settings[$counter]['title'] = miss_excerpt(get_the_title() . " ", apply_filters('miss_cat_slider_excerpt_length', $_len_title), '');
                     $slider_settings[$counter]['read_more'] = false;
                 } else {
                     $slider_settings[$counter]['read_more'] = true;
                 }
                 if ($_homepage_slider_stage == 'raw_html') {
                     $slider_settings[$counter]['description'] = get_the_excerpt();
                 }
                 $counter++;
             }
         }
     }
     $slider_keys = array_merge($slider_keys, array('#'));
     $slider_settings['slider_keys'] = join(',', $slider_keys);
     wp_reset_query();
     return $slider_settings;
 }
Пример #13
0
                <h4><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h4>
                <p>
                <?php 
                if (get_post_meta(get_the_ID(), 'app_description', true)) {
                    echo miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', get_the_content()), apply_filters('miss_home_spotlight_excerpt', THEME_ELLIPSIS));
                } else {
                    if (get_post_meta(get_the_ID(), 'app_pagetagline', true)) {
                        echo get_post_meta(get_the_ID(), 'app_pagetagline', true);
                    } else {
                        echo miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', get_the_content()), apply_filters('miss_home_spotlight_excerpt', THEME_ELLIPSIS));
                    }
                }
                ?>
                </p>
              </div>
            <?php 
            }
            ?>
            </div>
          </li>
          <?php 
        }
    }
    ?>
          </ul>
Пример #14
0
 /**
  *
  */
 function widget($args, $instance)
 {
     global $irish_framework_params;
     $prefix = MISS_PREFIX;
     extract($args);
     $title = apply_filters('widget_title', empty($instance['title']) ? __('Popular Posts', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base);
     if (!($number = (int) $instance['number'])) {
         $number = 3;
     } else {
         if ($number < 1) {
             $number = 1;
         } else {
             if ($number > 15) {
                 $number = 15;
             }
         }
     }
     echo $before_widget;
     echo $before_title . $title . $after_title;
     $count = !empty($count) ? trim($count) : '3';
     $disable_thumb = $instance['disable_thumb'] ? '1' : '0';
     $show_rating = !empty($instance['show_rating']) ? '1' : '0';
     $show_date = !empty($instance['show_date']) ? '1' : '0';
     $popular_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'orderby' => 'comment_count', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1));
     $out = '<ul class="post_list small_post_list">';
     while ($popular_query->have_posts()) {
         $popular_query->the_post();
         $out .= '<li class="post_list_module">';
         if (!$disable_thumb) {
             $widget_thumb_img = $irish_framework_params->layout['small_sidebar_images']['small_post_list'];
             $out .= miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false));
         }
         $out .= '<div class="post_list_content">';
         if ($show_rating && score_value(get_the_ID()) != 0) {
             $postid = get_the_ID();
             $score = score_value($postid);
             $out .= '<div class="rating_box">' . score_output($score, 'small') . '</div>';
         }
         $out .= '<p class="post_title">';
         $out .= '<a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>';
         $out .= '</p>';
         $out .= '<div class="post_excerpt">';
         $out .= miss_excerpt(get_the_excerpt(), apply_filters('miss_home_spotlight_excerpt', 55), apply_filters('miss_excerpt', THEME_ELLIPSIS));
         $out .= '</div>';
         $out .= '<div class="clearboth"></div>';
         /*
         			$get_year = get_the_time( 'Y', get_the_ID() );
         			$get_month = get_the_time( 'm', get_the_ID() );
         */
         if ($show_date) {
             $out .= '<p class="post_meta">';
             $out .= apply_filters('miss_widget_meta', do_shortcode('[post_date]'));
             $out .= '</p>';
         }
         $out .= '</div>';
         $out .= '</li>';
     }
     $out .= '</ul>';
     echo $out;
     echo $after_widget;
     wp_reset_postdata();
 }
Пример #15
0
     //$postslist = get_posts( $args );
     $column_count++;
     $column_class = 'span3';
     $column_class .= $column_count == 4 || $column_count == 3 && $articles['layout'] == 'left_sidebar' ? ' last' : '';
     $sid = get_the_id();
     $link = get_permalink($sid);
     echo '<div class="' . $column_class . '">';
     echo '<div class="entry has_preview">';
     if (has_post_thumbnail()) {
         $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium');
         $thumb = miss_wp_image($thumb[0], 518, 338);
         echo '<div class="post-thumbnail"><a href="' . get_permalink() . '" title="' . get_the_title() . '" class="pic"><img src="' . $thumb . '" class="image-resize w" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a></div>';
     }
     echo '<h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>';
     echo '<div class="date">' . get_the_time('l, M j Y') . '</div>';
     echo '<p>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_articles_excerpt', $articles['excerpt']['content']), apply_filters('miss_home_articles_excerpt', THEME_ELLIPSIS)) . '</p>';
     if ($articles["readmore"]["enable"] == true) {
         $readmore_caption = $articles['readmore']['label'] ? $articles['readmore']['label'] : __('Read More', MISS_TEXTDOMAIN);
         echo '<p class="read_more_block"><a class="post_more_link" href="' . esc_url($link) . '">' . $readmore_caption . '</a></p>';
         //echo miss_read_more( $title = $articles['readmore']['label'], $link = get_permalink() );
     }
     echo '</div>';
     echo '</div>';
 }
 if ($articles['layout'] == 'right_sidebar') {
     echo '<div class="span3 last">';
     echo miss_render_subblock($opt, $articles['subblock'], 'right');
     echo '</div>';
 }
 echo '</div>';
 echo '<div class="clearfix"></div>';
Пример #16
0
 $style = "";
 $service_count = 0;
 $query = new WP_Query();
 $query->query($args);
 while ($query->have_posts()) {
     $query->the_post();
     $service_count++;
     $sid = get_the_id();
     $link = get_permalink($sid);
     $out .= '<div class="entry service align-center" style="width: {{width}}%;"><div class="inner">';
     $style .= '.service' . get_the_id() . ' { background-image: url(' . get_post_meta(get_the_ID(), '_service_default', true) . '); width: ' . $services['width'] . 'px; height: ' . $services['height'] . 'px; padding: ' . $services['padding'] . 'px;}';
     $style .= '.service' . get_the_id() . ':hover { background-image: url(' . get_post_meta(get_the_ID(), '_service_active', true) . ');}';
     $styleInline = 'background-image: url(' . get_post_meta(get_the_ID(), '_service_default', true) . '); width: ' . $services['width'] . 'px; height: ' . $services['height'] . 'px; padding: ' . $services['padding'] . 'px;';
     $out .= '<h3><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>';
     $out .= '<a href="' . get_permalink() . '"><div class="service-icon ' . $services['style'] . ' service' . get_the_id() . '" data-style="' . $styleInline . '"><div class="height: ' . $services['height'] . 'px; width: ' . $services['width'] . 'px;" data-src="' . get_post_meta(get_the_ID(), '_service_default', true) . '"></div></div></a>';
     $out .= '<p>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_services_excerpt', $services['excerpt']['content']), apply_filters('miss_home_services_excerpt', THEME_ELLIPSIS)) . '</p>';
     if ($services["readmore"]["enable"] == true) {
         //  $out .= '<span class="post_more_link"><a class="post_more_link_a" href="' . esc_url( $link ) . '">'. $spotlight['readmore']['label'] . '</a></span>';
         $readmore_caption = $services['readmore']['label'] ? $services['readmore']['label'] : __('Read More', MISS_TEXTDOMAIN);
         $out .= '<p class="read_more_block"><a class="post_more_link" href="' . esc_url($link) . '">' . $readmore_caption . '</a></p>';
         // $out .= miss_read_more( $services['readmore']['label'], $link );
     }
     $out .= '</div></div>';
 }
 $service_width = 100 / $service_count;
 $out = str_replace('{{width}}', $service_width, $out);
 //$out .= $out;
 $out .= '</div>';
 $out .= '</div>';
 $out .= '<div class="clearfix"></div>';
 $style = '<style>' . $style . '</style>';
Пример #17
0
 /**
  * Rendering News Sections
  * @since 1.5
  */
 function miss_region_news($news = array())
 {
     $out = '';
     if (isset($news['enable'][0]) && $news['enable'][0] == "true") {
         $opt['custom'] = $news['custom'];
         $out .= '<!-- Begin News -->';
         $out .= '<div class="divider_dotted"></div>';
         $out .= '<div id="latest-news">';
         $out .= '<div class="inner">';
         $out .= '<h2 class="display-inline-block">' . $news['caption'] . '</h2>';
         $out .= '<div class="news-controls">';
         $out .= '<li class="news-readmore"><a href="' . $news['url'] . '">' . $news['more'] . '</a></li>';
         $out .= '</div>';
         $args = array('showposts' => $news['limit'], 'order' => 'DESC', 'orderby' => 'date', 'post_type' => 'news');
         $out .= '<div id="news-list">';
         $query = new WP_Query();
         $query->query($args);
         if ($query->have_posts()) {
             while ($query->have_posts()) {
                 $query->the_post();
                 // $postslist = get_posts( $args );
                 // foreach ($postslist as $post) {
                 //     setup_postdata($post);
                 $out .= '<div class="column6">';
                 $out .= '<div class="news-inner">';
                 if (has_post_thumbnail()) {
                     $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium');
                     $thumb = miss_wp_image($thumb[0], 207, 207);
                     $out .= '<div class="news_thumb post-thumbnail round">';
                     $out .= '<div class="post-thumbnail round"><a href="' . get_permalink() . '" title="' . get_the_title() . '" class="pic"><img src="' . $thumb . '" class="image-resize w" alt="' . get_the_title() . '" title="' . get_the_title() . '" /></a></div>';
                     $out .= '<div class="shadow small"></div>';
                     $out .= '</div>';
                 }
                 // $out .= '<div class="date ' . $news['date_style'] .'"><span class="span">' . get_the_time('M') . '</span><br /><span class="day">' . get_the_time('j') . '</span></div>';
                 $out .= '<div class="entry"><h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>' . miss_excerpt(get_the_excerpt(), apply_filters('miss_home_news_excerpt', $news['excerpt']['content']), apply_filters('miss_home_news_excerpt', THEME_ELLIPSIS)) . '</div>';
                 $out .= '</div>';
                 $out .= '</div>';
             }
         }
         $out .= '</ul>';
         $out .= '</div>';
         if ($news['layout'] == 'split') {
             $out .= '<div class="inner ' . $news['layout'] . ' pull-right">';
             $out .= miss_render_subblock($opt, $news['subblock']);
             $out .= '</div>';
         }
         $out .= '</div>';
         $out .= '<div class="clearfix"></div>';
     }
     return $out;
 }
Пример #18
0
 /**
  * Create recent posts dropdown mini blog
  * method: recent_posts_dropdown 
  *
  * @since 1.8
  */
 function recent_posts_dropdown(&$output, $args)
 {
     global $wpdb, $shortname, $irish_framework_params;
     // Menu type
     $menu_type = get_post_meta($args['menu_main_parent'], '_menu_item_type', true);
     $showposts = get_post_meta($args['menu_main_parent'], '_miss_submenu_columns', true) * 2;
     // WP Query template
     $menu_query = array('showposts' => $showposts, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
     // Check if category selected
     if (isset($menu_type)) {
         $category_id = get_post_meta($args['menu_main_parent'], '_menu_item_object_id', true);
         $category_term = get_post_meta($args['menu_main_parent'], '_menu_item_object', true);
         if (isset($category_term) && !empty($category_term) && (isset($category_id) && !empty($category_id) && $menu_type == "taxonomy")) {
             // $menu_query[$category_term] = $category_id;
             $menu_query['tax_query'] = array(array('taxonomy' => $category_term, 'field' => 'id', 'terms' => array($category_id)));
         }
     }
     $columns = get_post_meta($args['menu_main_parent'], '_miss_submenu_columns', true);
     $enable_full_width = get_post_meta($args['menu_main_parent'], '_miss_submenu_enable_full_width', true);
     $dropdown_width = get_post_meta($args['menu_main_parent'], '_miss_submenu_enable_full_width', true) == true ? 1170 - 30 : 479 - 30;
     // 30 - padding 30px
     $item_width_height = floor($dropdown_width / $columns);
     $details_height = floor($dropdown_width / 3);
     // Get menu items
     $recent_query = get_posts($menu_query);
     if (count($recent_query)) {
         foreach ($recent_query as $key => $post_object) {
             $output .= '<li class="post_preview li-menu-type-' . $menu_type . '">';
             $output .= '<a rel="bookmark" href="' . esc_url(get_permalink($post_object->ID)) . '" title="' . esc_attr($post_object->post_title) . '">';
             if (wp_get_attachment_image_src(get_post_thumbnail_id($post_object->ID), 'full')) {
                 $width = $irish_framework_params->layout['images']['menu_static_span6'][0];
                 $height = $irish_framework_params->layout['images']['menu_static_span6'][1];
                 $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_object->ID), 'full');
                 $output .= miss_get_post_image($args = array('pid' => $post_object->ID, 'img_class' => 'hover_fade_js image-resize w', 'width' => $item_width_height, 'height' => $item_width_height, 'echo' => false, 'preview_info_wrap' => false));
             } else {
                 $output .= get_post_meta($post_object->ID, '_icon', true) ? '<i class="' . get_post_meta($post_object->ID, '_icon', true) . '"></i> ' : '<i class="im-icon-quill-2"></i>';
             }
             $output .= '</a>';
             $output .= '<div class="after_menu_details">';
             if (get_post_thumbnail_id($post_object->ID) != false) {
                 $width = $irish_framework_params->layout['images']['menu_static_span12'][0];
                 $height = $irish_framework_params->layout['images']['menu_static_span12'][1];
                 $thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_object->ID), 'full');
                 if (miss_wp_image($thumb[0], $width, $height)) {
                     $output .= miss_get_post_image($args = array('pid' => $post_object->ID, 'img_class' => 'hover_fade_js image-resize w', 'width' => $dropdown_width, 'height' => $details_height, 'echo' => false, 'preview_info_wrap' => false));
                 }
             }
             $output .= '<div class="post_icon pull-left"><i class="' . get_post_meta($post_object->ID, '_icon', true) . '"></i></div>';
             $output .= '<div class="post_title">';
             $output .= '<a rel="bookmark" href="' . esc_url(get_permalink($post_object->ID)) . '" title="' . esc_attr($post_object->post_title) . '">' . $post_object->post_title . '</a>';
             $output .= '</div>';
             $output .= '<div class="post_excerpt">';
             $output .= miss_excerpt($post_object->post_content, apply_filters('miss_home_spotlight_excerpt', 60), apply_filters('miss_excerpt', THEME_ELLIPSIS));
             $output .= '</div>';
             $output .= '</div><!-- .after_menu_details -->';
             $output .= '</li><!-- .post_preview -->';
         }
         // end od foreach
     }
     $output .= '<li class="clearboth"></li><!-- .clearboth -->';
 }