/** * */ public static function twitter($atts = null) { if ($atts == 'generator') { $numbers = range(1, 20); foreach ($numbers as $val) { $number[$val] = $val; } $option = array('name' => __('Twitter', MISS_ADMIN_TEXTDOMAIN), 'value' => 'twitter', 'options' => array(array('name' => __('Username', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Paste your twitter username here. You can find your username by going to your settings page within twitter.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'id', 'default' => '', 'type' => 'text'), array('name' => __('Count', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select how many tweets you want to be displayed.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'number', 'default' => '', 'options' => $number, 'type' => 'select'), 'shortcode_has_atts' => true)); return $option; } $defaults = array('id' => '', 'number' => '1', 'title' => ' '); if (isset($atts['count'])) { $atts['number'] = $atts['count']; } if (isset($atts['username'])) { $atts['id'] = $atts['username']; } if (empty($atts['id'])) { $atts['id'] = miss_get_setting('twitter_id'); } $atts = wp_parse_args($atts, $defaults); $instance = http_build_query($atts); $args = array('widget_name' => 'IrishMissW_Twitter_Widget', 'instance' => $instance); $widget = new missWidgets(); return $widget->_widget_generator($args); }
/** * */ 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; }
/** * */ public static function im_partners($atts = null, $content = null) { if ($atts == 'generator') { return array('name' => __('Partners', MISS_ADMIN_TEXTDOMAIN), 'base' => 'im_partners', 'icon' => 'im-icon-trophy-star', 'category' => __('Theme Short-Codes', MISS_ADMIN_TEXTDOMAIN), 'params' => array(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")))); } extract(shortcode_atts(array('animation' => ''), $atts)); if ($animation != '') { $animation = ' im-animate-element ' . $animation . ' '; } $out = ''; $empty_cell = ""; if (miss_get_setting('disable_partners_section') == 'display_all' || miss_get_setting('disable_partners_section') == 'only_front_page' && is_front_page()) { $out .= ' <section class="row our-partners">'; if (miss_partners_shortcuts() != false) { $out .= ' <header class="section-header span12"> <h1 class="header"> <span>' . miss_get_setting('partners_caption') . '</span> </h1> </header>'; $out .= ' <div class="inner-wrapp span12">'; $partners = miss_get_setting('partners'); if ($partners['keys'] != '#' and $partners != '') { $partners_keys = explode(',', $partners['keys']); if (array_key_exists('#', $partners)) { unset($partners['#']); unset($partners['keys']); } $spans_in_row = miss_get_setting('partners_on_one_slide') ? miss_get_setting('partners_on_one_slide') : 6; $span_walk = 0; $row_walk = 1; $flag = false; $span_width = 100 / $spans_in_row; $counter_item = count($partners); $counter_row = $counter_item / $spans_in_row; if (!is_int($counter_row)) { $counter_row = ceil($counter_row); $counter_residue = $counter_item - ($counter_row - 1) * $spans_in_row; $counter_empty_cell = floor(($spans_in_row - $counter_residue) / 2); } else { $counter_residue = $counter_item - $counter_row * $spans_in_row; $counter_empty_cell = 0; } $counter_total_cell = $counter_item + $counter_empty_cell; foreach ($partners as $key => $value) { if (isset($partners[$key]['custom'])) { $out .= '<div class="content-item ' . $animation . '">'; $out .= '<a href="' . esc_url($partners[$key]['link']) . '"><img src="' . esc_url($partners[$key]['custom']) . '" alt="' . esc_url($partners[$key]['link']) . '" /></a>'; $out .= '</div>'; } } } $out .= ' </div>'; } $out .= ' </section><!-- /.region partners-->'; } return $out; }
function form($instance) { $default = array(); $defaults = array('title' => 'Footer Logo Widget', 'SubPages' => miss_get_setting('retina_SubPages_url')); $instance = wp_parse_args((array) $instance, $defaults); $SubPages = miss_get_setting('retina_SubPages_url'); if (empty($SubPages)) { // $SubPages = "http://cdn.irishmiss.com/i/bm/footerlogo.png"; } }
function form($instance) { $default = array(); $defaults = array('title' => 'Footer Logo Widget', 'footer_logo' => miss_get_setting('retina_footer_logo_url')); $instance = wp_parse_args((array) $instance, $defaults); $footer_logo = miss_get_setting('retina_footer_logo_url'); if (empty($footer_logo)) { $footer_logo = "http://cdn.irishmiss.com/i/bm/footerlogo.png"; } echo '<a href="' . home_url() . '" title="' . get_bloginfo('name') . '"><img src="' . $footer_logo . '" alt="' . get_bloginfo('name') . '" class="image-resize w" style="width: 300px; height: auto;" /></a>'; echo '<p><a href="' . home_url() . '/wp-admin/themes.php?page=miss-options">Change logo</a> → Branding → upload "Custom Footer Logo"</p>'; }
/** * */ function widget($args, $instance) { global $shortname; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Recent Tweets', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base); $tagline = apply_filters('widget_tagline', empty($instance['tagline']) ? __('Recent Tweets', MISS_TEXTDOMAIN) : $instance['tagline'], $instance, $this->id_base); $id = $instance['id']; if (!($number = (int) $instance['number'])) { $number = 5; } else { if ($number < 1) { $number = 1; } else { if ($number > 40) { $number = 40; } } } $username = isset($instance['id']) ? trim($instance['id']) : miss_get_setting('twitter_id'); $type = 'widget'; $miss_get_user_timeline = new miss_timeline_store($oauth_access_token = !empty($instance['oauth_access_token']) ? $instance['oauth_access_token'] : miss_get_setting('oauth_access_token'), $oauth_access_token_secret = !empty($instance['oauth_access_token_secret']) ? $instance['oauth_access_token_secret'] : miss_get_setting('oauth_access_token_secret'), $consumer_key = !empty($instance['consumer_key']) ? $instance['consumer_key'] : miss_get_setting('consumer_key'), $consumer_secret = !empty($instance['consumer_secret']) ? $instance['consumer_secret'] : miss_get_setting('consumer_secret'), $screen_name = $username, $count = $number); $results = $miss_get_user_timeline->returnTweet(); ?> <?php echo $before_widget; ?> <?php echo $before_title . $title . $after_title . '<h6>' . $tagline . '</h6>'; ?> <ul><?php if (isset($results) && is_array($results) && !empty($results)) { foreach ($results as $key => $tweet) { if ($key == "errors") { echo ''; /* echo '<li>'; echo $tweet[0]['message']; echo '</li>'; */ } else { echo '<li>'; echo '<a class="target_blank" target="_BLANK" href="http://twitter.com/1/status/' . $tweet['id_str'] . '" title="' . sprintf(esc_attr__('%1$s ago', MISS_TEXTDOMAIN), miss_relative_time(strtotime($tweet['created_at']))) . '">' . '<i class="im-icon-twitter pull-left"></i>' . miss_filter_tweet($tweet['text']) . '</a>'; echo '</li>'; } } } else { echo '<li>' . __('Tweets not found.', MISS_TEXTDOMAIN) . '</li>'; } ?> </ul><?php echo $after_widget; }
/** * */ function widget($args, $instance) { global $wpdb, $shortname, $irish_framework_params; $prefix = MISS_PREFIX; extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? __('Top Rated', 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; } } } $out = $before_widget; $out .= $before_title . $title . $after_title; $disable_thumb = $instance['disable_thumb'] ? '1' : '0'; $show_rating = $instance['show_rating'] ? '1' : '0'; $top_query = new WP_Query(array('showposts' => $number, 'nopaging' => 0, 'meta_key' => '_review_0', 'orderby' => 'meta_value', 'order' => 'DESC', 'post_status' => 'publish', 'category__not_in' => array(miss_exclude_category_string($minus = false)), 'ignore_sticky_posts' => 1)); if ($top_query->have_posts()) { $out .= '<ul class="post_list small_post_list">'; while ($top_query->have_posts()) { $top_query->the_post(); $out .= '<li class="post_list_module">'; 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' => 'post_list_image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false)); } $out .= '<div class="post_list_content">'; $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>'; $get_year = get_the_time('Y', get_the_ID()); $get_month = get_the_time('m', get_the_ID()); 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 .= '</div>'; $out .= '</li>'; } $out .= '</ul>'; } $out .= $after_widget; wp_reset_postdata(); echo $out; }
/** * Navigation Search Box * @since 1.5 */ function miss_nav_search_box($items, $args) { $disable_searchbox = apply_atomic('disable_searchbox', miss_get_setting('disable_searchbox')); if (!empty($disable_searchbox)) { return $items; } if ($args->theme_location == 'primary-menu') { ob_start(); get_search_form(); $searchform = ob_get_contents(); ob_end_clean(); $items .= '<li class="nav-search-box">' . $searchform . '<a class="search-button inactive" data-state="inactive">' . __("Search", MISS_TEXTDOMAIN) . '</a></li>'; } return $items; }
/** * */ function widget($args, $instance) { global $wpdb, $irish_framework_params; $prefix = MISS_PREFIX; $title = apply_filters('widget_title', empty($instance['title']) ? __('In Focus', MISS_TEXTDOMAIN) : $instance['title'], $instance, $this->id_base); extract($args); $post_id = array($instance['post_id']) ? array($instance['post_id']) : false; $args = array('showposts' => 1, 'post_status' => 'publish'); if (isset($post_id) && $post_id) { $args['post__in'] = $post_id; } $infocus_query = new WP_Query($args); $out = ''; echo $before_widget; $out .= '<div class="in_focus">'; while ($infocus_query->have_posts()) { $infocus_query->the_post(); if (!isset($disable_thumb)) { $widget_thumb_img = $irish_framework_params->layout['images']['blog_layout5']; $out .= miss_get_post_image(array('width' => $widget_thumb_img[0], 'height' => $widget_thumb_img[1], 'img_class' => 'in_focus_image', 'preload' => false, 'placeholder' => true, 'echo' => false, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false)); } $out .= '<div class="in_focus_bottom">'; $out .= ' <div class="bottom_bulk_box_field">'; $out .= ' <div class="box">'; $out .= ' <div class="post_title">'; $out .= ' <a rel="bookmark" href="' . esc_url(get_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . get_the_title() . '</a>'; $out .= ' </div>'; $out .= ' </div>'; /* $out .= ' <div class="bulk">'; $out .= ' </div>'; $out .= ' <div class="shadow">'; $out .= ' </div>'; */ $out .= ' </div><!-- class="bottom_bulk_box_field" -->'; $out .= '</div><!-- class="in_focus_bottom" -->'; } $out .= '</div><!-- class="in_focus" -->'; echo $out; echo $after_widget; }
/** * */ public static function image_frame($atts = null, $content = null) { if ($atts == 'generator') { $option = array('name' => __('Image Frames', MISS_ADMIN_TEXTDOMAIN), 'value' => 'image_frame', 'options' => array(array('name' => __('Type', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Choose which type of frame you wish to use.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'style', 'default' => '', 'options' => array('border' => __('Transparent Border', MISS_ADMIN_TEXTDOMAIN), 'reflect' => __('Reflection', MISS_ADMIN_TEXTDOMAIN), 'shadow' => __('Shadow', MISS_ADMIN_TEXTDOMAIN), 'reflect_shadow' => __('Reflection + Shadow', MISS_ADMIN_TEXTDOMAIN), 'framed_shadow' => __('Framed + Shadow', MISS_ADMIN_TEXTDOMAIN)), 'type' => 'select'), array('name' => __('Image URL', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('You can upload your image that you wish to use here.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'content', 'default' => '', 'type' => 'upload'), array('name' => __('Align <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Set the alignment for your image here.<br /><br />Your image will float along the center, left or right hand sides depending on your choice.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'align', 'default' => '', 'options' => array('left' => __('left', MISS_ADMIN_TEXTDOMAIN), 'right' => __('right', MISS_ADMIN_TEXTDOMAIN), 'center' => __('center', MISS_ADMIN_TEXTDOMAIN)), 'type' => 'select'), array('name' => __('Alt Attribute <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Type the alt text that you would like to display with your image here.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'alt', 'default' => '', 'type' => 'text'), array('name' => __('Title Attribute <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Type the title text that you would like to display with your image here.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'title', 'default' => '', 'type' => 'text'), array('name' => __('Image Height <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('You can set the image height here. Leave this blank if you do not want to resize your image.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'height', 'default' => '', 'type' => 'text'), array('name' => __('Image Width <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('You can set the image width here. Leave this blank if you do not want to resize your image.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'width', 'default' => '', 'type' => 'text'), 'shortcode_has_atts' => true)); return $option; } extract(shortcode_atts(array('style' => '', 'align' => '', 'alt' => '', 'title' => '', 'height' => '', 'width' => '', 'link_to' => 'true', 'prettyphoto' => 'true'), $atts)); global $wp_query, $irish_framework_params; $out = ''; $effect = trim($style); $effect = !empty($effect) ? $effect : 'framed'; $align = $align == 'left' ? ' alignleft' : ($align == 'right' ? ' alignright' : ($align == 'center' ? ' aligncenter' : ' alignleft')); $class = $effect == 'reflect' ? "reflect{$align}" : ($effect == 'reflect_shadow' ? 'reflect' : ($effect == 'framed' ? "framed{$align}" : ($effect == 'framed_shadow' ? 'framed' : ''))); $width = !empty($width) ? trim(str_replace(' ', '', str_replace('px', '', $width))) : ''; $height = !empty($height) ? trim(str_replace(' ', '', str_replace('px', '', $height))) : ''; if (preg_match('!http://.+\\.(?:jpe?g|png|gif)!Ui', $content, $matches)) { $out .= miss_display_image(array('src' => $matches[0], 'alt' => $alt, 'title' => $title, 'class' => $class, 'height' => $height, 'width' => $width, 'link_to' => $link_to == 'true' ? $matches[0] : false, 'prettyphoto' => $prettyphoto == 'true' ? true : false, 'align' => $align, 'effect' => $effect, 'wp_resize' => miss_get_setting('image_resize_type') == 'wordpress' ? true : false)); } //return '[raw]' . $out . '[/raw]'; return $out; }
/** * */ function miss_short_url($id, $format = 'txt', $history = 1) { $enable_bitly = miss_get_setting('url_shortening'); $bitly_login = miss_get_setting('bitly_login'); $bitly_api = miss_get_setting('bitly_api'); $url = get_post_meta($id, '_bitly_trim', true); $post_url = get_permalink($id); if (!$enable_bitly) { if ($url) { return $url; } $url = sprintf('%s?p=%s', home_url() . '/', $id); add_post_meta($id, '_bitly_trim', $url); return $url; } if (!empty($enable_bitly) && !empty($bitly_login) && !empty($bitly_api)) { if (!stristr($url, 'bit.ly')) { $bitly = 'http://api.bit.ly/v3/shorten?login='******'&apiKey=' . $bitly_api . '&uri=' . urlencode($post_url) . '&format=' . $format . '&history=' . $history; $response = wp_remote_retrieve_body(wp_remote_get($bitly)); if (is_wp_error($response)) { $url = sprintf('%s?p=%s', home_url() . '/', $id); add_post_meta($id, '_bitly_trim', $url); return $url; } $url = trim($response); delete_post_meta($id, '_bitly_trim'); add_post_meta($id, '_bitly_trim', $url); return $url; } return $url; } if ($url) { return $url; } $url = sprintf('%s?p=%s', home_url() . '/', $id); add_post_meta($id, '_bitly_trim', $url); return $url; }
/** * Return active Google Web Fonts * @since 1.8 */ function miss_get_gwf() { $fonts = array(); $gwf = miss_get_setting('google_web_fonts'); if ($gwf['keys'] != '#' and $gwf != '') { $gwf_keys = explode(',', $gwf['keys']); if (array_key_exists('#', $gwf)) { unset($gwf['#']); unset($gwf['keys']); } foreach ($gwf as $key => $value) { if (isset($gwf[$key]['gwf_face_name'])) { $font_safe_key = $gwf[$key]['gwf_face_name']; // Set font $fonts[$font_safe_key] = $font_safe_key; } } } return $fonts; }
function miss_render_page_layout() { if ($this->layout == 'full_width') { echo '<div class="primary_content ' . miss_get_setting('blog_layout') . '">'; get_template_part($this->template_part, $this->template, $this->template); echo '</div>'; } else { if ($this->layout == 'left_sidebar') { /*echo '<div class="blog-section '. miss_get_setting('blog_layout') .'">'; echo '<div class="container">'; echo '<div class="row">'; echo '<header class="section-header span12"> <h1 class="header"> <span>'.single_cat_title('', 0).'</span> </h1> </header>'; echo '<div class="span12"><div class="row">';*/ //$this->local_sidebar(); $this->local_content(); /*echo '</div></div>'; echo'</div>'; echo'</div>'; echo'</div>';*/ } else { /*echo '<div class="blog-section '. miss_get_setting('blog_layout') .'">'; echo '<div class="container">'; echo '<div class="row">'; if(is_category()) { echo '<header class="section-header span12"> <h1 class="header"> <span>'; echo single_cat_title('', 0); echo '</span> </h1> </header>'; } elseif(is_archive()) { echo '<div class="span12"><div class="bread-container"> <div class="bread-wrapper"> <div class="blog-title">'.post_type_archive_title('', false).'</div>'; dimox_breadcrumbs(); echo '</div> </div></div>'; } else { echo '<div class="span12"><div class="bread-container"> <div class="bread-wrapper"> <div class="blog-title">'.get_the_title().'</div>'; dimox_breadcrumbs(); echo '</div> </div></div>'; } echo '<div class="span12"><div class="row">';*/ $this->local_content(); //$this->local_sidebar(); /*echo '</div></div>'; echo'</div>'; echo'</div>'; echo'</div>';*/ } } }
$more_clases .= 'span6'; $spans_in_row = 2; break; case "blog_layout4": $excerpt_length = 80; $more_clases .= 'span4'; $spans_in_row = 3; break; case "blog_layout5": $excerpt_length = 145; $more_clases .= 'span3'; $spans_in_row = 4; break; } $animation = miss_get_setting('blog_layout_animation') ? ' im-animate-element ' . miss_get_setting('blog_layout_animation') : ''; $setings = miss_get_setting('disable_meta_options') ? miss_get_setting('disable_meta_options') : array(); $without_date = in_array('date_meta', $setings) ? ' without_date' : ''; $more_clases .= $without_date; $filter_args = array('width' => 200, 'height' => 228, 'img_class' => '', 'link_class' => 'sc_image_load', 'preload' => true, 'disable' => '', 'column' => $column, 'type' => $posttype, 'shortcode' => true, 'echo' => false, 'wraptitle' => false); ?> <!-- Blog Section - Start --> <section class="news-section"> <div class="container"> <div class="row"> <!-- Section Header - Start --> <header class="section-header span12"> <h1 class="header"> <span><?php post_type_archive_title('', true); ?> </span>
/** * */ public static function im_woocommerce($atts, $content = null, $code = null) { $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'); $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' => __('WooCommerce Layout', MISS_ADMIN_TEXTDOMAIN), 'base' => 'im_woocommerce', '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' => __('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', 'value' => 3), 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("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, $woocommerce; $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 . ' '; } $class = array_search($class, $classes) != false ? $class : 'grid'; $query_args = array('post_type' => 'product', 'showposts' => $showposts, 'offset' => $offset, 'nopaging' => 0, 'ignore_sticky_posts' => 1); 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' => 220, 'height' => 220, 'img_class' => $img_class, 'link_class' => 'sc_image_load', 'preload' => true, 'disable' => $disable, 'column' => $column, 'type' => 'product', 'shortcode' => true, 'echo' => false, 'wraptitle' => false); $spans_in_row = $column; $span_walk = 0; $row_walk = 1; /** * ¬озвращение контента в зависимости от класса * * */ if (is_user_logged_in()) { $linkprofile = '<a class="nav-item text small-text" href=' . get_permalink(get_option('woocommerce_myaccount_page_id')) . ' title="My Account">My Account</a>'; } else { $linkprofile = '<a class="nav-item text small-text" href="' . get_permalink(get_option('woocommerce_myaccount_page_id')) . '" title="My Account">My Account</a>'; } if (sizeof($woocommerce->cart->cart_contents) > 0) { $linkcheck = '<a href="' . $woocommerce->cart->get_checkout_url() . '" class="nav-item text small-text">Checkout</a>'; } else { $linkcheck = ''; } $out_caption = ''; if ($caption != '') { $out_caption = '<header class="section-header span12"> <nav class="basket-cpanel breaking-alignment"> <a class="basket" href="' . $woocommerce->cart->get_cart_url() . '"> <i class="marker"></i> </a> <div class="text-link-wrapper"> <a class="nav-item text" href="' . $woocommerce->cart->get_cart_url() . '">Cart</a> <span class="nav-item text cost">Total ' . $woocommerce->cart->get_cart_total() . '</span> <div class="break"></div> ' . $linkprofile . ' <span class="nav-item separator"> | </span> ' . $linkcheck . ' </div> </nav> <h1 class="header"> <span>' . $caption . '</span> </h1>'; if ($tagline != '') { $out_caption .= '<h3 class="header">' . $tagline . '</h3>'; } $out_caption .= '</header>'; } $out .= '<div class="inner-wrapp span12">'; while ($sc_post_query->have_posts()) { if ($spans_in_row * $row_walk == $span_walk) { $row_walk++; } $span_walk++; $sc_post_query->the_post(); $price = get_post_meta(get_the_id(), '_regular_price', true); $price_disc = get_post_meta(get_the_id(), '_sale_price', true); $out .= '<section class="content-item ' . $column_class . ' ' . $animation . '"> <header class="header"> <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="' . miss_get_post_image(array('width' => 'auto', 'height' => 'auto', 'get_src' => true, 'echo' => false)) . '" rel="prettyPhoto[' . get_post_type() . '_' . get_the_ID() . ']" class="control zoom"><i class="marker im-icon-zoom-in"></i></a> </div> </div> </div> <div class="price">'; if ($price) { $out .= '<span class="small">' . get_woocommerce_currency_symbol() . ' ' . $price . '</span> <span class="big">' . get_woocommerce_currency_symbol() . ' ' . $price_disc . '</span>'; } $out .= '</div> </header> <article class="article"> <p>' . miss_post_title($filter_args) . '</p> </article> <a href="' . esc_url(get_permalink()) . '" class="btn ribbon-style small-ribbon">Read more</a> </section>'; } $out .= '</div><!-- /.row-fluid -->'; $out = '<div class="row featured-products">' . $out_caption . $out . '</div><!-- /.sc_layout-->'; } return $out; }
/** * */ function miss_enqueue_script() { global $wp_query; # Styles array $miss_styles = array('prettyphoto' => MISS_PREFIX . '_prettyphoto'); # Scripts array $miss_script = array('comments' => 'comment-reply', 'tabs' => MISS_PREFIX . '_jquery_tools_tabs', 'flexslider' => MISS_PREFIX . '_flexslider', 'form' => MISS_PREFIX . '_jquery_form', 'prettyphoto' => MISS_PREFIX . '_prettyphoto', 'froogaloop2' => MISS_PREFIX . '_froogaloop2', 'custom' => MISS_PREFIX . '_custom'); $options = get_option(MISS_SETTINGS); $slider_type = apply_filters('miss_slider_type', miss_get_setting('homepage_slider')); $post_obj = $wp_query->get_queried_object(); # Front page if (is_front_page()) { # check widgets for shortcodes if (is_active_sidebar('home')) { $widget_sc = miss_sc_widget_text(); if (in_array('flexslider', $widget_sc)) { $flex_unset = false; } if (in_array('tabs', $widget_sc)) { $tabs_unset = false; } # contact form widget is active if (is_active_widget(false, false, 'contact_form', true)) { $contactform_unset = false; } } } # Singular post/page if (is_singular()) { $dependencies = get_post_meta($post_obj->ID, '_' . THEME_SLUG . '_dependencies', true); # check post meta for scripts if (strpos($dependencies, 'miss_scripts') === false && ($options['blog_page'] != $post_obj->ID || empty($options['display_full']))) { if (strpos($dependencies, 'flexslider') === false) { $flex_unset = true; } if (strpos($dependencies, 'tabs') === false) { $tabs_unset = true; } if (strpos($dependencies, 'contactform') === false) { $contactform_unset = true; } } # post comment styles set to tab if (apply_atomic('post_comment_styles', $options['post_comment_styles']) == 'tab' && is_single()) { $tabs_unset = false; } # popular/related post set to tab if (apply_atomic('post_like_module', $options['post_like_module']) == 'tab' && is_single()) { $tabs_unset = false; } } # if search, archive or 404 page if (is_archive() || is_search() || is_404()) { $flex_unset = true; $tabs_unset = true; $contactform_unset = true; } # check text widgets for shortcodes if (!is_front_page()) { $widget_sc = miss_sc_widget_text(); if (in_array('flexslider', $widget_sc)) { $flex_unset = false; } if (in_array('tabs', $widget_sc)) { $tabs_unset = false; } # contact form widget is active if (is_active_widget(false, false, 'contact_form', true)) { $contactform_unset = false; } } # If slider on every page option enabled if (apply_filters('miss_slider_page', miss_get_setting('slider_page'))) { if ($slider_type == 'flexslider') { $flex_unset = false; } } # unset tabs/fading slider if (!empty($tabs_unset)) { //unset( $miss_script['tabs'] ); # unset flex if (!empty($flex_unset)) { unset($miss_script['flexslider']); } } # unset form if (!empty($contactform_unset)) { unset($miss_script['form']); } # unset WP comment-reply if (!is_singular() || !comments_open() || get_option('thread_comments') != 1) { unset($miss_script['comments']); } # unset buddypress if not exists if (!function_exists('bp_is_active')) { /* unset bp styles */ unset($miss_styles['bp_defaults']); unset($miss_styles['bp_admin_bar']); /* unset bp scripts */ unset($miss_script["bp"]); } # Styles filter $enqueue_styles = apply_atomic('styles', $miss_styles); if (!empty($enqueue_styles)) { foreach ($enqueue_styles as $style) { wp_enqueue_style($style); } } # Scripts filter $enqueue_script = apply_atomic('scripts', $miss_script); if (!empty($enqueue_script)) { foreach ($enqueue_script as $script) { wp_enqueue_script($script); } } //enqueue scripts $data = miss_local_assets('assets'); if (!miss_is_template('templates/template-works.php')) { $data = miss_unload_assets($data, 'isotope'); } if (miss_get_setting('responsive') == 'disabled') { $data = miss_unload_assets($data, 'responsive'); } if (get_post_type() == 'miss_gallery') { wp_register_script('miss_gallery', '' . THEME_JS . '/gallery/init.js', false, null, true); wp_register_script('qs', '' . THEME_JS . '/jquery/jquery.quicksand.js', false, null, true); wp_register_script('nicescroll', '' . THEME_JS . '/jquery/jquery.nicescroll.js', false, null, true); wp_enqueue_script('nicescroll'); wp_enqueue_script('qs'); } miss_collect_assets($data, $property = 'scripts', $action = 'enqueue'); }
<div class="blog-section <?php echo miss_get_setting('blog_layout'); ?> "> <div class="container"> <div class="row"> <div class="span12"> <div class="row"> <!-- Content Area --> <div class="loop_module featured-products span12"> <div id="page-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="loop_content products"> <?php miss_before_entry(); ?> <div class="post_excerpt"> <?php miss_woocommerce_content(); ?> <div class="clearboth"></div> <?php //echo miss_pagenavi(); ?> </div><!-- .entry --> <div class="clearboth"></div>
/** * */ 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; }
function form($instance) { $defaults = array('title' => 'Social Networks', 'color' => '#0000FF', 'description' => 'Website powered by Irish Miss theme'); // $defaults = array( 'title' => 'Footer Logo Widget', 'footer_logo' => miss_get_setting('retina_footer_logo_url') ); $instance = wp_parse_args((array) $instance, $defaults); /* $out = '<select id="' . $this->get_field_id( 'skin' ) . '" class="widefat" name="' . $this->get_field_name( 'skin' ) . '">'; $skins = miss_sociable_option(); foreach ( $skins as $key => $val ) { $selected = ( $instance['skin'] == $key ) ? ' selected="selected"' : '' ; $out .= '<option' . $selected. ' value="' . $key . '">' . $val . '</option>'; } $out .= '</select>'; */ ?> <p> <label for="<?php print $this->get_field_id('title'); ?> ">Widget Title:</label> <input class="widefat" id="<?php print $this->get_field_id('title'); ?> " name="<?php print $this->get_field_name('title'); ?> " value="<?php print $instance['title']; ?> " /> </p> <p> <label for="<?php print $this->get_field_id('title'); ?> ">Custom Text:</label> <input class="widefat" id="<?php print $this->get_field_id('description'); ?> " name="<?php print $this->get_field_name('description'); ?> " value="<?php print $instance['description']; ?> " /> </p> <?php $sociable = miss_get_setting('sociable'); $sociables = ""; if ($sociable['keys'] != '#') { $sociable_keys = explode(',', $sociable['keys']); foreach ($sociable_keys as $key) { if ($key != '#') { if (!empty($sociable[$key]['custom'])) { $sociable_icon = $sociable[$key]['custom']; } $sociable_link = !empty($sociable[$key]['link']) ? $sociable[$key]['link'] : '#'; $sociables .= '<div class="social_icon" style="display: inline; padding-right: 4px;">'; $sociables .= '<a href="' . esc_url($sociable_link) . '"><i class="fs-icon-' . $sociable[$key]['icon'] . '"></i></a>'; $sociables .= '</div>'; } } } echo $sociables; }
<?php $rev = array(); $criteria = miss_get_setting('criteria'); if ($criteria['keys'] != '#') { $criteria_keys = explode(',', $criteria['keys']); foreach ($criteria_keys as $ckey) { if ($ckey != '#') { $criteria_name = !empty($criteria[$ckey]['link']) ? $criteria[$ckey]['link'] : '#'; $rev[$ckey] = array('name' => $criteria_name . ' score: ', 'id' => '_review_' . $ckey, 'type' => 'select', 'options' => array('0.5' => '0.5', '1' => '1', '1.5' => '1.5', '2' => '2', '2.5' => '2.5', '3' => '3', '3.5' => '3.5', '4' => '4', '4.5' => '4.5', '5' => '5')); } } } $meta_boxes = array('title' => sprintf(__('%1$s Review', MISS_ADMIN_TEXTDOMAIN), THEME_NAME), 'id' => 'miss_review', 'pages' => array('post', 'portfolio'), 'callback' => '', 'context' => 'normal', 'priority' => 'high', 'fields' => $rev); return array('load' => true, 'options' => $meta_boxes);
/** * Define theme variables. * * @since 1.0 */ public static function variables() { global $irish_framework_params; # Long posts should require a higher limit, see http://core.trac.wordpress.org/ticket/8553 @ini_set('pcre.backtrack_limit', 9000000); # Large posts should require a higher execution time limit, see http://core.trac.wordpress.org/ticket/16799 @ini_set('max_execution_time', 180); # Pingpack should use allow_url_fopen http://core.trac.wordpress.org/ticket/1166 //@ini_set('allow_url_fopen',1); $img_set = get_option(MISS_SETTINGS); $img_set = !empty($img_set) && !isset($_POST[MISS_SETTINGS]['reset']) ? $img_set : array(); $blog_layout = apply_filters('miss_blog_layout', miss_get_setting('blog_layout')); /* Image Dimensions */ $images = array('menu_static_span12' => array(1170, 360), 'menu_static_span6' => array(558, 558), 'span12' => array(!empty($img_set['one_column_portfolio_big']['w']) ? $img_set['one_column_portfolio_big']['w'] : 1170, !empty($img_set['one_column_portfolio_big']['h']) ? $img_set['one_column_portfolio_big']['h'] : 520), 'span6' => array(!empty($img_set['two_column_portfolio_big']['w']) ? $img_set['two_column_portfolio_big']['w'] : 570, !empty($img_set['two_column_portfolio_big']['h']) ? $img_set['two_column_portfolio_big']['h'] : 376), 'span4' => array(!empty($img_set['three_column_portfolio_big']['w']) ? $img_set['three_column_portfolio_big']['w'] : 370, !empty($img_set['three_column_portfolio_big']['h']) ? $img_set['three_column_portfolio_big']['h'] : 250), 'span3' => array(!empty($img_set['four_column_portfolio_big']['w']) ? $img_set['four_column_portfolio_big']['w'] : 270, !empty($img_set['four_column_portfolio_big']['h']) ? $img_set['four_column_portfolio_big']['h'] : 216), 'blog_layout1' => array(!empty($img_set['blog_layout1_full']['w']) ? $img_set['blog_layout1_full']['w'] : 1090, !empty($img_set['blog_layout1_full']['h']) ? $img_set['blog_layout1_full']['h'] : 430), 'blog_layout2' => array(!empty($img_set['blog_layout2_full']['w']) ? $img_set['blog_layout2_full']['w'] : 320, !empty($img_set['blog_layout2_full']['h']) ? $img_set['blog_layout2_full']['h'] : 230), 'blog_layout3' => array(!empty($img_set['blog_layout3_full']['w']) ? $img_set['blog_layout3_full']['w'] : 485, !empty($img_set['blog_layout3_full']['h']) ? $img_set['blog_layout3_full']['h'] : 275), 'blog_layout4' => array(!empty($img_set['blog_layout4_full']['w']) ? $img_set['blog_layout4_full']['w'] : 285, !empty($img_set['blog_layout4_full']['h']) ? $img_set['blog_layout4_full']['h'] : 200), 'blog_layout5' => array(!empty($img_set['blog_layout5_full']['w']) ? $img_set['blog_layout5_full']['w'] : 270, !empty($img_set['blog_layout5_full']['h']) ? $img_set['blog_layout5_full']['h'] : 270), 'blog_grid_one_col' => array(!empty($img_set['blog_grid_two_col_full']['w']) ? $img_set['blog_grid_two_col_full']['w'] : 570, !empty($img_set['blog_grid_two_col_full']['h']) ? $img_set['blog_grid_two_col_full']['h'] : 290), 'blog_grid_two_col' => array(!empty($img_set['blog_grid_two_col_full']['w']) ? $img_set['blog_grid_two_col_full']['w'] : 570, !empty($img_set['blog_grid_two_col_full']['h']) ? $img_set['blog_grid_two_col_full']['h'] : 290), 'blog_grid_three_col' => array(!empty($img_set['blog_grid_three_col_full']['w']) ? $img_set['blog_grid_three_col_full']['w'] : 370, !empty($img_set['blog_grid_three_col_full']['h']) ? $img_set['blog_grid_three_col_full']['h'] : 370), 'small_post_list' => array(!empty($img_set['small_post_list_full']['w']) ? $img_set['small_post_list_full']['w'] : 50, !empty($img_set['small_post_list_full']['h']) ? $img_set['small_post_list_full']['h'] : 50), 'medium_post_list' => array(!empty($img_set['medium_post_list_full']['w']) ? $img_set['medium_post_list_full']['w'] : 100, !empty($img_set['medium_post_list_full']['h']) ? $img_set['medium_post_list_full']['h'] : 100), 'large_post_list' => array(!empty($img_set['large_post_list_full']['w']) ? $img_set['large_post_list_full']['w'] : 200, !empty($img_set['large_post_list_full']['h']) ? $img_set['large_post_list_full']['h'] : 200), 'portfolio_single_full' => array(!empty($img_set['portfolio_single_full_big']['w']) ? $img_set['portfolio_single_full_big']['w'] : 1170, !empty($img_set['portfolio_single_full_big']['h']) ? $img_set['portfolio_single_full_big']['h'] : 776), 'additional_posts_grid' => array(!empty($img_set['additional_posts_grid_big']['w']) ? $img_set['additional_posts_grid_big']['w'] : 216, !empty($img_set['additional_posts_grid_big']['h']) ? $img_set['additional_posts_grid_big']['h'] : 138)); $big_sidebar_images = array('span12' => array(!empty($img_set['one_column_portfolio_big']['w']) ? $img_set['one_column_portfolio_big']['w'] : 870, !empty($img_set['one_column_portfolio_big']['h']) ? $img_set['one_column_portfolio_big']['h'] : 436), 'span6' => array(!empty($img_set['two_column_portfolio_big']['w']) ? $img_set['two_column_portfolio_big']['w'] : 424, !empty($img_set['two_column_portfolio_big']['h']) ? $img_set['two_column_portfolio_big']['h'] : 282), 'span4' => array(!empty($img_set['three_column_portfolio_big']['w']) ? $img_set['three_column_portfolio_big']['w'] : 275, !empty($img_set['three_column_portfolio_big']['h']) ? $img_set['three_column_portfolio_big']['h'] : 216), 'span3' => array(!empty($img_set['four_column_portfolio_big']['w']) ? $img_set['four_column_portfolio_big']['w'] : 201, !empty($img_set['four_column_portfolio_big']['h']) ? $img_set['four_column_portfolio_big']['h'] : 190), 'blog_layout1' => array(!empty($img_set['blog_layout1_big']['w']) ? $img_set['blog_layout1_big']['w'] : 790, !empty($img_set['blog_layout1_big']['h']) ? $img_set['blog_layout1_big']['h'] : 330), 'blog_layout2' => array(!empty($img_set['blog_layout2_big']['w']) ? $img_set['blog_layout2_big']['w'] : 320, !empty($img_set['blog_layout2_big']['h']) ? $img_set['blog_layout2_big']['h'] : 230), 'blog_layout3' => array(!empty($img_set['blog_layout3_big']['w']) ? $img_set['blog_layout3_big']['w'] : 424, !empty($img_set['blog_layout3_big']['h']) ? $img_set['blog_layout3_big']['h'] : 220), 'blog_layout4' => array(!empty($img_set['blog_layout4_big']['w']) ? $img_set['blog_layout4_big']['w'] : 275, !empty($img_set['blog_layout4_big']['h']) ? $img_set['blog_layout4_big']['h'] : 183), 'blog_layout5' => array(!empty($img_set['blog_layout5_big']['w']) ? $img_set['blog_layout5_big']['w'] : 201, !empty($img_set['blog_layout5_big']['h']) ? $img_set['blog_layout5_big']['h'] : 201), 'small_post_list' => array(!empty($img_set['small_post_list_big']['w']) ? $img_set['small_post_list_big']['w'] : 80, !empty($img_set['small_post_list_big']['h']) ? $img_set['small_post_list_big']['h'] : 80), 'medium_post_list' => array(!empty($img_set['medium_post_list_big']['w']) ? $img_set['medium_post_list_big']['w'] : 200, !empty($img_set['medium_post_list_big']['h']) ? $img_set['medium_post_list_big']['h'] : 200), 'large_post_list' => array(!empty($img_set['large_post_list_big']['w']) ? $img_set['large_post_list_big']['w'] : 395, !empty($img_set['large_post_list_big']['h']) ? $img_set['large_post_list_big']['h'] : 285), 'portfolio_single_full' => array(!empty($img_set['portfolio_single_full_big']['w']) ? $img_set['portfolio_single_full_big']['w'] : 870, !empty($img_set['portfolio_single_full_big']['h']) ? $img_set['portfolio_single_full_big']['h'] : 576), 'additional_posts_grid' => array(!empty($img_set['additional_posts_grid_big']['w']) ? $img_set['additional_posts_grid_big']['w'] : 216, !empty($img_set['additional_posts_grid_big']['h']) ? $img_set['additional_posts_grid_big']['h'] : 138)); $small_sidebar_images = array('span12' => array(!empty($img_set['one_column_portfolio_big']['w']) ? $img_set['one_column_portfolio_big']['w'] : 870, !empty($img_set['one_column_portfolio_big']['h']) ? $img_set['one_column_portfolio_big']['h'] : 436), 'span6' => array(!empty($img_set['two_column_portfolio_big']['w']) ? $img_set['two_column_portfolio_big']['w'] : 424, !empty($img_set['two_column_portfolio_big']['h']) ? $img_set['two_column_portfolio_big']['h'] : 282), 'span4' => array(!empty($img_set['three_column_portfolio_big']['w']) ? $img_set['three_column_portfolio_big']['w'] : 275, !empty($img_set['three_column_portfolio_big']['h']) ? $img_set['three_column_portfolio_big']['h'] : 216), 'span3' => array(!empty($img_set['four_column_portfolio_big']['w']) ? $img_set['four_column_portfolio_big']['w'] : 201, !empty($img_set['four_column_portfolio_big']['h']) ? $img_set['four_column_portfolio_big']['h'] : 190), 'blog_layout1' => array(!empty($img_set['blog_layout1_big']['w']) ? $img_set['blog_layout1_big']['w'] : 790, !empty($img_set['blog_layout1_big']['h']) ? $img_set['blog_layout1_big']['h'] : 330), 'blog_layout2' => array(!empty($img_set['blog_layout2_big']['w']) ? $img_set['blog_layout2_big']['w'] : 320, !empty($img_set['blog_layout2_big']['h']) ? $img_set['blog_layout2_big']['h'] : 230), 'blog_layout3' => array(!empty($img_set['blog_layout3_big']['w']) ? $img_set['blog_layout3_big']['w'] : 424, !empty($img_set['blog_layout3_big']['h']) ? $img_set['blog_layout3_big']['h'] : 220), 'blog_layout4' => array(!empty($img_set['blog_layout4_big']['w']) ? $img_set['blog_layout4_big']['w'] : 275, !empty($img_set['blog_layout4_big']['h']) ? $img_set['blog_layout4_big']['h'] : 183), 'blog_layout5' => array(!empty($img_set['blog_layout5_big']['w']) ? $img_set['blog_layout5_big']['w'] : 201, !empty($img_set['blog_layout5_big']['h']) ? $img_set['blog_layout5_big']['h'] : 201), 'small_post_list' => array(!empty($img_set['small_post_list_big']['w']) ? $img_set['small_post_list_big']['w'] : 80, !empty($img_set['small_post_list_big']['h']) ? $img_set['small_post_list_big']['h'] : 80), 'medium_post_list' => array(!empty($img_set['medium_post_list_big']['w']) ? $img_set['medium_post_list_big']['w'] : 200, !empty($img_set['medium_post_list_big']['h']) ? $img_set['medium_post_list_big']['h'] : 200), 'large_post_list' => array(!empty($img_set['large_post_list_big']['w']) ? $img_set['large_post_list_big']['w'] : 395, !empty($img_set['large_post_list_big']['h']) ? $img_set['large_post_list_big']['h'] : 285), 'portfolio_single_full' => array(!empty($img_set['portfolio_single_full_big']['w']) ? $img_set['portfolio_single_full_big']['w'] : 870, !empty($img_set['portfolio_single_full_big']['h']) ? $img_set['portfolio_single_full_big']['h'] : 576), 'additional_posts_grid' => array(!empty($img_set['additional_posts_grid_big']['w']) ? $img_set['additional_posts_grid_big']['w'] : 216, !empty($img_set['additional_posts_grid_big']['h']) ? $img_set['additional_posts_grid_big']['h'] : 138)); // Rest Images foreach ($images as $key => $value) { foreach ($value as $img => $size) { $size = str_replace(' ', '', $size); $new_size[$img] = str_replace('px', '', $size); } $images[$key] = $new_size; if (function_exists('add_image_size')) { add_image_size($new_size['0'] . 'x' . $new_size['1'], $new_size[0], $new_size[1], true); } } foreach ($big_sidebar_images as $key => $value) { foreach ($value as $img => $size) { $size = str_replace(' ', '', $size); $new_size[$img] = str_replace('px', '', $size); } $big_sidebar_images[$key] = $new_size; if (function_exists('add_image_size')) { add_image_size($new_size['0'] . 'x' . $new_size['1'], $new_size[0], $new_size[1], true); } } foreach ($small_sidebar_images as $key => $value) { foreach ($value as $img => $size) { $size = str_replace(' ', '', $size); $new_size[$img] = str_replace('px', '', $size); } $small_sidebar_images[$key] = $new_size; if (function_exists('add_image_size')) { add_image_size($new_size['0'] . 'x' . $new_size['1'], $new_size[0], $new_size[1], true); } } // Blog layouts switch ($blog_layout) { case "blog_layout1": $layout = array('blog_layout' => $blog_layout, 'main_class' => 'post_grid blog_layout1', 'post_class' => 'post_grid_module', 'content_class' => 'post_grid_content', 'featured' => '', 'img_class' => 'post_grid_image has_preview'); break; case "blog_layout2": $columns_num = 1; $featured = is_archive() || is_search() ? false : false; $columns = 'span12'; $layout = array('blog_layout' => $blog_layout, 'main_class' => 'post_grid blog_layout2', 'post_class' => 'post_grid_module', 'content_class' => 'post_grid_content', 'img_class' => 'post_grid_image has_preview', 'columns_num' => !empty($columns_num) ? $columns_num : '', 'featured' => !empty($featured) ? $featured : '', 'columns' => !empty($columns) ? $columns : ''); break; case "blog_layout3": $columns_num = 2; $featured = is_archive() || is_search() ? false : false; $columns = 'span6'; $layout = array('blog_layout' => $blog_layout, 'main_class' => 'post_grid blog_layout3', 'post_class' => 'post_grid_module', 'content_class' => 'post_grid_content', 'img_class' => 'post_grid_image has_preview', 'columns_num' => !empty($columns_num) ? $columns_num : '', 'featured' => !empty($featured) ? $featured : '', 'columns' => !empty($columns) ? $columns : ''); break; case "blog_layout4": $columns_num = 3; $columns = 'span4'; $layout = array('blog_layout' => $blog_layout, 'main_class' => 'post_grid blog_layout4', 'post_class' => 'post_grid_module', 'content_class' => 'post_grid_content', 'img_class' => 'post_grid_image has_preview', 'columns_num' => !empty($columns_num) ? $columns_num : '', 'columns' => !empty($columns) ? $columns : ''); break; case "blog_layout5": $columns_num = 4; $columns = 'span3'; $layout = array('blog_layout' => $blog_layout, 'main_class' => 'post_grid blog_layout5', 'post_class' => 'post_grid_module', 'content_class' => 'post_grid_content', 'img_class' => 'post_grid_image has_preview', 'columns_num' => !empty($columns_num) ? $columns_num : '', 'columns' => !empty($columns) ? $columns : ''); break; } if (isset($layout)) { $irish_framework_params->layout['blog'] = $layout; } $irish_framework_params->layout['images'] = array_merge($images, array('image_padding' => 2)); $irish_framework_params->layout['big_sidebar_images'] = $big_sidebar_images; $irish_framework_params->layout['small_sidebar_images'] = $small_sidebar_images; $irish_framework_params->layout['images_slider'] = isset($images_slider) ? $images_slider : ''; /* Getting variables */ if (!function_exists('getImages')) { function getImages() { return $this->images; } } }
/** * */ 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; }
/** * */ 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; }
/** * */ function miss_display_image($args = array()) { if (!defined('THEME_HIRES')) { define('THEME_HIRES', miss_get_setting('hires') == 'enabled' ? 2 : 1); } global $wp_query, $irish_framework_params; //print_r($args); extract($args); if (empty($src) && empty($video_src) && $noimage == true || empty($src) && empty($video_src) && !is_single()) { return '<img src="' . miss_wp_image(THEME_IMAGES_ASSETS . '/general/no-thumbnail.png', $width, $height) . '" />'; } if (empty($src) && empty($video_src)) { return; } if (empty($src) && !empty($video_src)) { $out = miss_video(array('url' => $video_src, 'width' => $width, 'height' => $height, 'parse' => true, 'video_controls' => $video_controls)); } else { $image = $src; //Trying to build array from string // $image_path = explode( $_SERVER['SERVER_NAME'], $image ); $image_path = explode(home_url('/'), $image); //For local images if (!empty($image_path[1])) { // In this case we'll define image ABSOLUTE PATH // $image_path = $_SERVER['DOCUMENT_ROOT'] . $image_path[1]; $image_path = ABSPATH . $image_path[1]; $image_info = @getimagesize($image_path); } else { // In this case we'll define iamge URI if (ini_get('allow_url_fopen')) { $image_path = $image; $image_info = @getimagesize($image); } else { if (function_exists('curl_init')) { //if allow_url_fopen is off trying to reach curl $image_headers = get_headers($image, 1); if ($image_headers['Content-Type'] == "image/jpeg") { $remote_extrnsion = ".jpg"; } if ($image_headers['Content-Type'] == "image/gif") { $remote_extrnsion = ".gif"; } if ($image_headers['Content-Type'] == "image/png") { $remote_extrnsion = ".png"; } if (is_writable(THEME_CACHE)) { if (!file_exists(THEME_CACHE . '/downloads')) { if (@mkdir(THEME_CACHE . '/downloads')) { // Crete safe index @touch(THEME_CACHE . '/downloads/index.html'); } } $image_downloads = THEME_CACHE . '/donwloads'; } else { $image_downloads = THEME_CACHE; } // Trying to reach local file if (file_exists($image_downloads . '/' . md5($image) . $remote_extension)) { $image_path = $image_downloads . '/' . md5($image) . $remote_extension; $image_info = @getimagesize($image_path); } else { if (isset($remote_extension) && !empty($remote_extension)) { $image_downloads .= '/' . md5($image) . $remote_extension; $ch = curl_init($image); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $image_raw_data = curl_exec($ch); curl_close($ch); //Unlinking if file exists if (file_exists($image_downloads)) { unlink($image_downloads); } $fp = fopen($image_downloads, 'x'); fwrite($fp, $image_raw_data); fclose($fp); $image_path = $image_downloads; $image_info = @getimagesize($image_path); } } } else { } } } # If we cannot get the image locally, try for an external URL if (empty($image_info)) { $image_info = @getimagesize($image); } if (miss_video($args = array('url' => $image))) { $src = THEME_IMAGES_ASSETS . '/movie_thumb.png'; } else { if (empty($image_info) && $noimage == true || empty($image_info) && !is_single()) { $src = THEME_IMAGES_ASSETS . '/general/no-thumbnail.png'; } } if (empty($image_info) && $noimage == false) { return; } # Auto crop width if (empty($no_preload_img) && (empty($width) || !is_numeric($width))) { $width = !empty($width) ? $width : ''; $width = miss_auto_width(array('width' => $width, 'get_width' => $image_info[0])); } $width = !empty($width) ? trim(str_replace(' ', '', str_replace('px', '', $width))) : $image_info[0]; $height = !empty($height) ? trim(str_replace(' ', '', str_replace('px', '', $height))) : $image_info[1]; $image_resize = miss_get_setting('image_resize'); $image_alt = ''; if (isset($disable_resize)) { $image = $src; } elseif (!empty($wp_resize)) { $image = miss_wp_image($src, $width, $height); if (THEME_HIRES == 2) { $image_alt .= ' data-retina="' . miss_wp_image($src, $width * THEME_HIRES, $height * THEME_HIRES) . '"'; } /* mark for changes */ } elseif (!empty($width) and !empty($height)) { $image = miss_wp_image($src, $width, $height); if (THEME_HIRES == 2) { $image_alt .= ' data-retina="' . miss_wp_image($src, $width * THEME_HIRES, $height * THEME_HIRES) . '"'; } /* END mark for changes */ } elseif (miss_get_setting('image_resize_type') == 'timthumb' && !$image_resize[0] && miss_is_cache_writable() && ($image_info[0] != $width || $image_info[1] != $height)) { $image = THEME_URI . '/framework/scripts/timthumb/thumb.php?src=' . miss_wpmu_image($src) . '&w=' . $width . '&h=' . $height . '&zc=1&q=100'; } else { $image = $src; } $img_width = $width ? ' width="' . esc_attr($width) . '"' : ''; $img_height = $height ? ' height="' . esc_attr($height) . '"' : ''; $class = !empty($class) ? ' class="' . esc_attr($class) . ' image-resize w"' : ' class="image-resize w"'; $title = !empty($title) ? esc_attr($title) : ''; $alt = !empty($alt) ? esc_attr($alt) : ''; //echo $image; if ($get_src) { $out = esc_url($image); } else { $out = '<img' . $class . ' src="' . esc_url($image) . '" title="' . $title . '"' . $image_alt . ' alt="' . $alt . '"' . ' />'; } } /*if( isset( $preview_info_wrap ) && $preview_info_wrap != false ){ $prettyphoto = ( $prettyphoto != false ) ? '[' . $prettyphoto . ']' : false; if ( $video_src != '' ) { $link = $video_src; $icon = 'im-icon-movie'; } else { $link = $src; $icon = 'im-icon-zoom-in'; } $out .= '<div class="preview_info_wrap">'; if ( is_single() ) { $out .= '<a class="controls img single" href="' . esc_url( $link ) . '" rel="prettyPhoto' . $prettyphoto . '">'; $out .= '<i class="' . $icon . '"></i>'; $out .= '</a> <!-- /.controls -->'; } else { $out .= '<a class="controls img" href="' . esc_url( $link ) . '" rel="prettyPhoto' . $prettyphoto . '">'; $out .= '<i class="' . $icon . '"></i>'; $out .= '</a> <!-- /.controls -->'; $out .= '<a class="controls link" href="' . esc_url( $link_to ) . '" title="' . $title . '">'; $out .= '<i class="im-icon-link"></i>'; $out .= '</a> <!-- /.controls -->'; } $out .= '</div>'; };*/ $link_style = ''; # Image preloader $loader_img = ''; /*if( !empty( $preload ) ) { $offset = $irish_framework_params->layout['images']['image_padding']; $load_width = $width + $offset; $load_height = $height + $offset; $no_preload_img = "1"; if( empty( $no_preload_img ) ) { $link_style = ' style="background:no-repeat center center;display:block;position:relative;height:' . esc_attr( $load_height ) . 'px;width:' . esc_attr( $load_width ) . 'px;' . ( $image_resize[0] ? 'overflow:hidden;' : '' ) . '"'; $loader_img = '<div class="miss_preloader"><img src="' . esc_url( THEME_IMAGES_ASSETS . '/transparent.gif' ) . '" style="background-image: url(' . THEME_IMAGES_ASSETS . '/preloader.gif);background-position:left center; width:16px; height:16px;"></div>'; } if( empty( $link_to ) && empty( $no_preload_img ) ) { $out = $loader_img . '<div class="plain post-image data-image">' . $out . '</div>'; } else { $out = '<div class="plain post-image data-image">' . $out . '</div>'; } }*/ $effect = isset($effect) ? $effect : ''; # Image links to /*if ( isset( $no_link ) && $no_link == true ) { $link_class = ( !empty( $link_class ) ) ? ' class="' . $link_class . '"' : ''; $group = ( !empty( $group ) ) ? '[' . $group . ']' : ''; $rel = ( !empty( $prettyphoto ) && is_single() ) ? ' rel="prettyPhoto' . $group . '"' : ''; $out = '<div ' . $link_class . $link_style . '>' . $out . $loader_img . '</div>'; } */ /* elseif ( !empty( $link_to ) && $effect != 'border' ) { $link_class = ( !empty( $link_class ) ) ? ' class="' . $link_class . '"' : ''; $group = ( !empty( $group ) ) ? '[' . $group . ']' : ''; $rel = ( !empty( $prettyphoto ) && is_single() ) ? ' rel="prettyPhoto' . $group . '"' : ''; $out = '<a' . $rel . ' href="' . esc_url( $link_to ) . '" title="' . $title . '"' . $link_class . $link_style . '>' . $out . $loader_img . '</a>'; } */ # Image effects /*if( !empty( $effect ) && $effect != 'framed' ) { $image = $out; $out = ''; if( $effect == 'border' ) { if( trim( $align ) == 'aligncenter' ) { $out .= '<div class="' . trim( $align ) . '">'; $aligncenter = true; $align = ''; } $out .= '<span class="transparent_frame' . $align . '">' . $image; $out .= '<a href="' . esc_url( $link_to ) . '" rel="prettyPhoto">'; $out .= '<img alt="" src="' . esc_url( THEME_IMAGES . '/shortcodes/transparent.gif' ) . '" style="height:' . esc_attr( $height-10 ) . 'px;width:' . esc_attr( $width-10 ) . 'px;" class="transparent_border">'; $out .= '</a>'; $out .= '</span>'; if( isset( $aligncenter ) == 'aligncenter' ) $out .= '</div>'; } if( $effect == 'shadow' || $effect == 'framed_shadow' || $effect == 'reflect_shadow' ) { if( trim( $align ) == 'aligncenter' ) { $out .= '<div class="' . trim( $align ) . '">'; $aligncenter = true; $align = ''; } $out .= '<span class="shadow_frame' . $align . '">' . $image; $out .= '<img alt="" src="' . esc_url( THEME_IMAGES . '/shortcodes/image_shadow.png' ) . '" style="width:' . esc_attr( $width ) . 'px;' . ( $effect == 'reflect_shadow' ? 'top:' . -floor($width*0.128) . 'px;' : '' ) . '" class="image_shadow">'; $out .= '</span>'; if( isset( $aligncenter ) == 'aligncenter' ) $out .= '</div>'; } if( $effect == 'reflect' ) { if( trim( $align ) == 'aligncenter' ) { $out .= '<div class="' . trim( $align ) . '">'; $aligncenter = true; $align = ''; } $out .= $image; if( isset( $aligncenter ) == 'aligncenter' ) $out .= '</div>'; } }*/ return $out; }
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; }
post_class(); ?> > <div class="row"> <?php /** * woocommerce_show_product_images hook * * @hooked woocommerce_show_product_sale_flash - 10 * @hooked woocommerce_show_product_images - 20 */ do_action('woocommerce_before_single_product_summary'); ?> <?php if (miss_get_setting('store_display_share_buttons') == 'yes') { ?> <div class="soc_block"> <div class="ttl">SHARE WITH FRIENDS:</div> <div class="share42init" data-url="<?php the_permalink(); ?> " data-title="<?php the_title(); ?> "></div> <script type="text/javascript" src="<?php echo THEME_URI; ?> /assets/js/share42.js"></script> </div>
?> "> <div id="page-<?php the_ID(); ?> " <?php post_class(); ?> > <div class="single_content"> <?php miss_before_entry(); ?> <div class="page_content"> <?php if (miss_get_setting('review') == 'enable') { echo the_score($post->ID); } ?> <?php the_content(); ?> <div class="clearboth"></div> <?php if ($meta['enabled']) { ?> <h3><?php echo $meta['caption']; ?>
//} ?> /* * Twitter Application */ <?php function miss_validate_twitter_keyword($username) { $regexp = '/^([\\x09-\\x0D\\x20\\x85\\xA0]|\\xe1\\x9a\\x80|\\xe1\\xa0\\x8e|\\xe2\\x80[\\x80-\\x8a,\\xa8,\\xa9,\\xaf\\xdf]|\\xe3\\x80\\x80)*[#@@]([a-zA-Z0-9_]{1,20})/'; return preg_match($regexp, $username); } $twitter = miss_get_setting('twitter_url'); if (!isset($twitter) || $twitter == "" || miss_validate_twitter_keyword($twitter) == 0) { $twitter = "#envato"; } $miss_get_user_timeline = new miss_timeline_store($oauth_access_token = miss_get_setting('oauth_access_token'), $oauth_access_token_secret = miss_get_setting('oauth_access_token_secret'), $consumer_key = miss_get_setting('consumer_key'), $consumer_secret = miss_get_setting('consumer_secret'), $screen_name = str_replace(array("@", "#"), array("", ""), $twitter), $count = "10", $json = true); ?> Application = {}; Application.Tweets = { init: function () { var a = { q: "<?php echo $twitter; ?> ", rpp: 10 }, c = <?php echo $miss_get_user_timeline->returnTweet(); ?>
function miss_footer($args = array('echo' => 'true')) { if (!is_home() && !is_page()) { return; } $out = '<footer class="base-layout"> <div class="container"> <div class="row"> <div class="span12"> <div class="caption alig-center"> ' . stripcslashes(miss_get_setting('footer_contacts')) . ' </div> </div> </div> </div> </footer>'; /*$out .= ' <footer>'; $out .= ' <div class="container">'; $out .= ' <div class="row-fluid">'; $out .= ' <div class="span6">'; if ( has_nav_menu('footer-links') ) { $menu_args = array( 'theme_location' => 'footer-links', 'container' => 'nav', 'container_class' => 'navbar', 'menu_class' => 'nav', 'echo' => false, ); $out .= wp_nav_menu($menu_args); } $out .= ' <div class="clearboth"></div>'; $out .= ' <div class="copyrights">'; $out .= stripcslashes(miss_get_setting('footer_text')); $out .= ' </div>'; $out .= ' </div><!-- /.span6-->'; $out .= ' <div class="span3">'; $out .= miss_header_sociable( array( 'echo' => false, 'container_class' => 'sociable' ) ); $out .= ' </div><!-- /.span3-->'; $out .= ' <div class="span3">'; if( miss_get_setting('footer_contacts') != '' ){ $out .= '<h4 class="footer_contact_info">' . miss_get_setting('footer_title') . '</h4>'; $out .= '<pre class="contacts">' . stripcslashes(miss_get_setting('footer_contacts')) . '</pre>'; } $out .= ' </div><!-- /.span3-->'; $out .= ' </div><!-- /.row-fluid-->'; $out .= ' </div><!-- /.container-->'; $out .= ' </footer><!-- /.region footer-->'; */ if ($args['echo'] == 'true') { echo apply_atomic_shortcode('miss_footer', $out); } else { return $out; } }
/** * */ 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>'; }