/** * */ public static function im_imageframe($atts = null, $content = null) { if ($atts == 'generator') { return array('name' => __('Framed Image', MISS_ADMIN_TEXTDOMAIN), 'base' => 'im_imageframe', 'icon' => 'im-icon-image-4', 'category' => __('Theme Short-Codes', MISS_ADMIN_TEXTDOMAIN), 'params' => array(array('heading' => __('Type', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Choose which type of frame you wish to use.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'style', 'value' => array(__('Default', MISS_ADMIN_TEXTDOMAIN) => '', __('Transparent Border', MISS_ADMIN_TEXTDOMAIN) => 'border', __('Reflection', MISS_ADMIN_TEXTDOMAIN) => 'reflect', __('Shadow', MISS_ADMIN_TEXTDOMAIN) => 'shadow', __('Reflection + Shadow', MISS_ADMIN_TEXTDOMAIN) => 'reflect_shadow', __('Framed + Shadow', MISS_ADMIN_TEXTDOMAIN) => 'framed_shadow'), 'type' => 'dropdown'), array('heading' => __('Image URL', MISS_ADMIN_TEXTDOMAIN), 'description' => __('You can upload your image that you wish to use here.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'image', 'type' => 'attach_image', 'value' => ''), array('heading' => __('Align <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('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), 'param_name' => 'align', 'value' => array(__('left', MISS_ADMIN_TEXTDOMAIN) => 'left', __('right', MISS_ADMIN_TEXTDOMAIN) => 'right', __('center', MISS_ADMIN_TEXTDOMAIN) => 'center'), 'type' => 'dropdown'), array('heading' => __('Alt Attribute <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Type the alt text that you would like to display with your image here.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'alt', 'value' => '', 'type' => 'textfield'), array('heading' => __('Title Attribute <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('Type the title text that you would like to display with your image here.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'title', 'value' => '', 'type' => 'textfield'), array('heading' => __('Image Height <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('You can set the image height here. Leave this blank if you do not want to resize your image.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'height', 'value' => '', 'type' => 'textfield'), array('heading' => __('Image Width <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'description' => __('You can set the image width here. Leave this blank if you do not want to resize your image.', MISS_ADMIN_TEXTDOMAIN), 'param_name' => 'width', 'value' => '', 'type' => 'textfield'), 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")), 'shortcode_has_atts' => true)); return $option; } extract(shortcode_atts(array('image' => '', 'style' => '', 'align' => '', 'alt' => '', 'title' => '', 'height' => '', 'width' => '', 'animation' => '', 'effect' => '', 'link_to' => 'true', 'prettyphoto' => 'true'), $atts)); if ($animation != '') { $animation = ' im-animate-element ' . $animation . ' '; } global $wp_query, $irish_framework_params; $out = ''; if (isset($image) && $image != '') { $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' : ''))); $class .= $animation; $width = !empty($width) ? trim(str_replace(' ', '', str_replace('px', '', $width))) : ''; $height = !empty($height) ? trim(str_replace(' ', '', str_replace('px', '', $height))) : ''; if (is_numeric($image)) { $image = wp_get_attachment_url($image); } $out .= miss_display_image(array('src' => $image, 'alt' => $alt, 'title' => $title, 'class' => $class, 'height' => $height, 'width' => $width, 'align' => $align, 'effect' => $effect)); } //return '[raw]' . $out . '[/raw]'; return $out; }
public static function styled_images($atts = null, $content = null) { if ($atts == 'generator') { $option = array('name' => __('Styled Images', MISS_ADMIN_TEXTDOMAIN), 'value' => 'styled_images', 'options' => array(array('name' => __('Width', MISS_ADMIN_TEXTDOMAIN), "desc" => __('Set the width for your image. Leave this blank if you do not want your image to be resized.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'width', 'type' => 'text', 'shortcode_dont_multiply' => true), array('name' => __('Height', MISS_ADMIN_TEXTDOMAIN), "desc" => __('Set the width for your image. Leave this blank if you do not want your image to be resized.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'height', 'type' => 'text', 'shortcode_dont_multiply' => true), array('name' => __('Number of images', MISS_ADMIN_TEXTDOMAIN), "desc" => __('Select how many images you wish to display.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'multiply', 'options' => range(1, 20), 'type' => 'select', 'shortcode_multiplier' => true), array('name' => __('Image 1 URL', MISS_ADMIN_TEXTDOMAIN), "desc" => __('You can upload the image you wish to use here.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'content', 'type' => 'upload', 'shortcode_multiply' => true), array('name' => __('Image 1 Title Attribute <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), "desc" => __('Type out the title text you wish to use with your image.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'title', 'type' => 'text', 'shortcode_multiply' => true), array('name' => __('Image 1 Alt Attribute <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), "desc" => __('Type out the alt text you wish to use with your image.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'alt', 'type' => 'text', 'shortcode_multiply' => true), array('name' => __('Image 1 Custom Link <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), "desc" => __('By default when a reader clicks on your image it will open in a lightbox.<br /><br />You can paste a URL here to use instead.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'link_to', 'type' => 'text', 'shortcode_multiply' => true), array('value' => 'image', 'nested' => true), 'shortcode_has_atts' => true)); return $option; } global $irish_framework_params; extract(shortcode_atts(array('width' => '', 'height' => '', 'class' => 'true'), $atts)); $out = ''; $width = !empty($width) ? trim(str_replace(' ', '', str_replace('px', '', $width))) : $irish_framework_params->layout['images']['three_column_portfolio'][0]; $height = !empty($height) ? trim(str_replace(' ', '', str_replace('px', '', $height))) : $irish_framework_params->layout['images']['three_column_portfolio'][1]; if (!preg_match_all('/(.?)\\[(image)\\b(.*?)(?:(\\/))?\\](?:(.+?)\\[\\/image\\])?(.?)/s', $content, $matches)) { if (preg_match_all('!http://.+\\.(?:jpe?g|png|gif)!Ui', $content, $matches)) { $group = 'styled_img_group_' . rand(1, 1000); $out .= '<div class="styled_images">'; foreach ($matches[0] as $img) { $out .= '<div class="styled_image im-transform im-animate-element scale-up">'; $out .= miss_display_image(array('src' => $img, 'alt' => '', 'title' => '', 'height' => $height, 'width' => $width, 'class' => $class == 'true' ? 'hover_fade_js' : '', 'link_to' => $img, 'link_class' => 'styled_image_load', 'prettyphoto' => true, 'group' => $group, 'preload' => true)); $out .= '</div>'; } $out .= '</div>'; } } else { for ($i = 0; $i < count($matches[0]); $i++) { $matches[3][$i] = shortcode_parse_atts($matches[3][$i]); } $group = 'styled_img_group_' . rand(1, 1000); $out .= '<div class="styled_images">'; for ($i = 0; $i < count($matches[0]); $i++) { $img = $matches[5][$i]; $alt = isset($matches[3][$i]['alt']) ? $matches[3][$i]['alt'] : ''; $title = isset($matches[3][$i]['alt']) ? $matches[3][$i]['title'] : ''; $link_to = !empty($matches[3][$i]['link_to']) ? $matches[3][$i]['link_to'] : $img; $prettyphoto = !empty($matches[3][$i]['link_to']) && strpos($matches[3][$i]['link_to'], 'iframe') === false ? false : true; $out .= '<div class="styled_image">'; $out .= miss_display_image(array('src' => $img, 'alt' => $alt, 'title' => $title, 'height' => $height, 'width' => $width, 'class' => $class == 'true' ? 'hover_fade_js' : '', 'link_to' => $link_to, 'link_class' => 'styled_image_load', 'prettyphoto' => $prettyphoto, 'group' => $group, 'preload' => true)); $out .= '</div>'; } $out .= '</div>'; } //return '[raw]' . $out . '[/raw]'; return $out; }
/** * */ 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_get_post_image($args = array()) { global $irish_framework_params; $defaults = array('index' => '', 'img_class' => '', 'pid' => false, 'src' => false, 'column' => '', 'thumb' => '', 'width' => false, 'height' => false, 'link_class' => '', 'video' => '', 'link_to' => '', 'no_link' => false, 'noimage' => true, 'preview_info_wrap' => true, 'preload' => false, 'prettyphoto' => true, 'video_controls' => false, 'echo' => true, 'featured_post' => false); $args = wp_parse_args($args, $defaults); extract($args); if ($pid) { $post_thumbnail_id = get_post_thumbnail_id($pid); } else { $post_thumbnail_id = get_post_thumbnail_id(); } $auto_img = miss_get_setting('auto_img'); if (!is_string($src)) { if (empty($post_thumbnail_id) && $auto_img[0]) { $image = miss_image_by_attachment(); if ($image) { $image[0] = $image['url']; $alt = $image['alt']; } else { if (!empty($placeholder) && $noimage == true) { //$image[0] = THEME_IMAGES_ASSETS . '/general/no-thumbnail.png';] return false; } } } elseif (empty($post_thumbnail_id) && !empty($placeholder)) { if (!is_single() && $noimage == true) { //$image[0] = THEME_IMAGES_ASSETS . '/general/no-thumbnail.png';] return false; } } elseif (empty($post_thumbnail_id)) { $image[0] = ''; if (!is_single() && $noimage == true) { //$image[0] = THEME_IMAGES_ASSETS . '/general/no-thumbnail.png'; return false; } } if (!empty($post_thumbnail_id)) { $image = wp_get_attachment_image_src($post_thumbnail_id, ''); } } else { $image[0] = $src; } if (!isset($link_to) || $link_to == '') { $link_to = !empty($args['video']) ? get_permalink() : (is_single() && isset($image[0]) ? $image[0] : get_permalink()); } $video_src = get_post_meta(get_the_ID(), '_featured_video', true) != false ? get_post_meta(get_the_ID(), '_featured_video', true) : ''; $preview_info_wrap = isset($args['preview_info_wrap']) ? $args['preview_info_wrap'] : true; $prettyphoto = isset($prettyphoto) ? get_post_type() . '_' . get_the_ID() : ((is_single() || is_page()) && empty($placeholder) ? get_post_type() . '_' . get_the_ID() : false); $image_tags = miss_post_image_tags($post_thumbnail_id, get_the_ID()); $img_args = array('src' => $image[0], 'video_src' => $video_src, 'alt' => isset($alt) ? $alt : $image_tags['alt'], 'title' => $image_tags['title'], 'height' => $height, 'width' => $width, 'class' => '', 'link_to' => $link_to, 'no_link' => isset($no_link) ? $no_link : false, 'preview_info_wrap' => isset($preview_info_wrap) ? $preview_info_wrap : false, 'prettyphoto' => $prettyphoto, 'link_class' => $link_class, 'preload' => $preload, 'portfolio_full' => !empty($portfolio_full) ? true : false, 'video_controls' => $video_controls, 'wp_resize' => !empty($wp_resize) ? true : true); if ($get_src) { $img_args['get_src'] = true; } $post_img = miss_display_image($img_args); $offset = $irish_framework_params->layout['images']['image_padding']; $load_width = $width + $offset; $load_height = $height + $offset; ///$out = '<div class="services-image ' . $img_class . '"' . ( !empty( $inline_width ) ? ' data-style="width:' . $load_width . 'px;"' : '' ) . '>'; /*if( empty( $placeholder ) ) { ob_start(); miss_post_image_begin(); $out .= ob_get_clean(); }*/ $out = $post_img; /* if( empty( $placeholder ) ) { ob_start(); miss_post_image_end( $args ); $out .= ob_get_clean(); }*/ //$out .= '</div>'; if ($img_class != "na") { if (!empty($echo)) { echo $out; } else { return $out; } } }
/** * */ function miss_flex($slider_type, $slider) { global $irish_framework_params; $img_sizes = $irish_framework_params->layout['images_slider']; $slider_keys = explode(',', $slider['slider_keys']); if (!isset($img_sizes['flexslide'])) { $img_sizes['flexslide'][0] = 'auto'; $img_sizes['flexslide'][1] = 'auto'; } $img = array('w' => $img_sizes['flexslide'][0], 'h' => $img_sizes['flexslide'][1]); $out = '<div class="miss_preloader_large" style="text-align:center;">'; $out .= '<img src="' . THEME_IMAGES_ASSETS . '/transparent.gif" style="background-image: url(' . THEME_IMAGES_ASSETS . '/preloader.gif);">'; $out .= '</div>'; $out .= '<div class="miss_flexslider">'; $out .= '<ul class="slides">'; foreach ($slider_keys as $key) { if ($key != '#') { $link_n = !empty($slider[$key]['link_url']) ? $slider[$key]['link_url'] : ''; $slide_img = esc_url($slider[$key]['slider_url']); $img_alt = !empty($slider[$key]['alt_attr']) ? esc_attr($slider[$key]['alt_attr']) : ''; $out .= '<li>'; if (preg_match_all('!.+\\.(?:jpe?g|png|gif)!Ui', $slide_img, $matches)) { $title = !empty($slider[$key]['title']) ? $slider[$key]['title'] : ''; $description = !empty($slider[$key]['description']) ? $slider[$key]['description'] : ''; if (!empty($title) || !empty($description)) { $out .= '<a href="' . $link_n . '" class="flex-imageLink">'; $out .= miss_display_image(array('src' => $slide_img, 'alt' => $img_alt, 'width' => 'auto', 'height' => 'auto')); if (!empty($description)) { $out .= '<div class="flex-caption"><h2 class="slider_title">' . $title . '</h2><div class="slider_desc">' . $description . '</div></div>'; } else { $out .= '<p class="flex-caption"><span class="slider_title">' . $title . '</span>'; } $out .= '</a>'; } else { $out .= '<a href="' . $link_n . '" class="flex-imageLink">'; $out .= miss_display_image(array('src' => $slide_img, 'alt' => $img_alt)); $out .= '</a>'; } } else { if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^"&?/ ]{11})%i', $slide_img, $match)) { $video_source = "youtube"; $video_id = $match[1]; $out .= '<iframe id="player" src="http://www.youtube.com/embed/' . $video_id . '" width="580" height="387" frameborder="0" webkitallowfullscreen allowfullscreen></iframe>'; // $out .= '<div id="' . $video_id . '" rel="' . $slide_img . '" class="' . $video_source . '_video"></div>'; } if (0 === preg_match('/^http:\\/\\/(www\\.)?vimeo\\.com\\/(clip\\:)?(\\d+).*$/', $slide_img, $match)) { } else { $video_source = "vimeo"; $video_id = $match[3]; $out .= '<iframe id="player" src="http://player.vimeo.com/video/' . $video_id . '?api=1&player_id=player" width="580" height="387" frameborder="0" webkitallowfullscreen allowfullscreen></iframe>'; } } $out .= '</li>'; } } $out .= '</ul>'; $out .= '</div><!-- #miss_flexslider -->'; miss_slider_script($slider_type); return $out; }
/** * */ public static function portfolio_grid($atts) { if ($atts == 'generator') { $option = array('name' => __('Portfolio Grid', MISS_ADMIN_TEXTDOMAIN), 'value' => 'portfolio_grid', 'options' => array(array('name' => __('Number of Columns', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select the number of columns you would like your posts to display in.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'column', 'default' => '', 'options' => array('1' => __('One Column', MISS_ADMIN_TEXTDOMAIN), '2' => __('Two Column', MISS_ADMIN_TEXTDOMAIN), '3' => __('Three Column', MISS_ADMIN_TEXTDOMAIN), '4' => __('Four Column', MISS_ADMIN_TEXTDOMAIN)), 'type' => 'select'), array('name' => __('Number of Portfolio Posts', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select the number of posts you would like to display on each page.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'showposts', 'default' => '', 'options' => array_combine(range(1, 40), array_values(range(1, 40))), 'type' => 'select'), array('name' => __('Portfolio Categories <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('Select which portfolio categories you would like to display.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'cat', 'default' => array(), 'target' => 'portfolio_category', 'type' => 'select'), array('name' => __('Offset Portfolio Posts <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('This will skip a number of posts at the beginning.<br /><br />Useful if you are using multiple portfolio shortcodes on the same page.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'offset', 'default' => '', 'options' => array_combine(range(1, 10), array_values(range(1, 10))), 'type' => 'select'), array('name' => __('Disable Portfolio Elements <small>(optional)</small>', MISS_ADMIN_TEXTDOMAIN), 'desc' => __('You can hide certain elements from displaying here.', MISS_ADMIN_TEXTDOMAIN), 'id' => 'disable', 'options' => array('image' => __('Disable Post Image', MISS_ADMIN_TEXTDOMAIN), 'title' => __('Disable Post Title', MISS_ADMIN_TEXTDOMAIN), 'excerpt' => __('Disable Post Excerpt', MISS_ADMIN_TEXTDOMAIN), 'date' => __('Disable Date', MISS_ADMIN_TEXTDOMAIN), 'more' => __('Disable Read More', MISS_ADMIN_TEXTDOMAIN), 'visit' => __('Disable Visit Site', MISS_ADMIN_TEXTDOMAIN), 'pagination' => __('Disable Pagination', MISS_ADMIN_TEXTDOMAIN)), 'default' => '', 'type' => 'checkbox'), 'shortcode_has_atts' => true)); return $option; } extract(shortcode_atts(array('column' => '4', 'showposts' => '8', 'cat' => array(), 'offset' => '', 'disable' => ''), $atts)); $out = ''; $portfolio_query = new WP_Query(); if (isset($cat)) { global $post, $wp_rewrite, $wp_query, $irish_framework_params; $column = trim($column); $showposts = trim($showposts); // $cat = trim( $cat ); $offset = trim($offset); 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); // $images = ( $_layout == 'full_width' ? 'images' : ( $_layout == 'left_sidebar' ? 'small_sidebar_images' : 'big_sidebar_images' ) ); } $paged = miss_get_page_query(); $gallery_post = $post->post_name; if ($post->post_parent) { $parent_query = get_post($post->post_parent); $gallery_parent = $parent_query->ID; } if (is_numeric($offset) && strpos($disable, 'pagination') === false) { $irish_framework_params->offset = $offset; $irish_framework_params->posts_per_page = $showposts; add_filter('post_limits', 'my_post_limit'); } if (strpos($disable, 'pagination') === false) { $args = array('post_type' => 'portfolio', 'posts_per_page' => $showposts, 'taxonomy' => 'portfolio_category', 'term' => $cat, 'offset' => $offset, 'paged' => $paged); } else { $args = array('post_type' => 'portfolio', 'showposts' => $showposts, 'taxonomy' => 'portfolio_category', 'term' => $cat, 'offset' => $offset, 'nopaging' => 0); } if (isset($cat) && !empty($cat)) { $args['tax_query'] = array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cat)); } $portfolio_query = new WP_Query(); $portfolio_query->query($args); } if ($portfolio_query->have_posts()) { $img_sizes = $irish_framework_params->layout['big_sidebar_images']; $img_group = 'portfolio_img_group_' . rand(1, 1000); $width = ''; $height = ''; switch ($column) { case 1: $column_class = 'span12 has_preview'; $width = $img_sizes['span12'][0]; $height = $img_sizes['span12'][1]; break; case 2: $column_class = 'span6 has_preview'; $width = $img_sizes['span6'][0]; $height = $img_sizes['span6'][1]; break; case 3: $column_class = 'span4 has_preview'; $width = $img_sizes['span4'][0]; $height = $img_sizes['span4'][1]; break; case 4: $column_class = 'span3 has_preview'; $width = $img_sizes['span3'][0]; $height = $img_sizes['span3'][1]; break; } $main_class = 'loop_module works portfolio row-fluid'; $out .= '<div class="' . $main_class . '">'; $i = 1; while ($portfolio_query->have_posts()) { $portfolio_query->the_post(); $id = get_the_ID(); $custom_fields = get_post_custom($id); foreach ($custom_fields as $key => $value) { ${$key}[$id] = $value[0]; if (is_serialized(${$key}[$id])) { ${$key}[$id] = unserialize(${$key}[$id]); } } if (has_post_thumbnail() || !empty($_image[$id]) || !empty($_featured_video[$id])) { if (has_post_thumbnail()) { $img = wp_get_attachment_image_src(get_post_thumbnail_id($id), 'full', true); } else { $img[0] = !empty($_image[$id]) ? $_image[$id] : ''; } if ($wp_rewrite->using_permalinks()) { $url = home_url('/') . 'portfolio/' . $post->post_name . '/gallery/' . $gallery_post . '/'; } else { $url = htmlspecialchars(add_query_arg(array('gallery' => $gallery_post), get_permalink($id))); } $link_to = empty($_post[$id][0]) ? empty($_featured_video[$id]) ? empty($_image[$id]) ? $img[0] : $_image[$id] : $_featured_video[$id] : $url; $out .= '<div class="portfolio_item ' . ($i % $column == 0 ? $column_class . ' last' : $column_class) . ' im-transform im-animate-element scale-up">'; $out .= '<div class="' . join(' ', get_post_class('post_grid_module', get_the_ID())) . '">'; if (strpos($disable, 'image') === false) { $offset = $irish_framework_params->layout['images']['image_padding']; $load_width = $width + $offset; $load_height = $height + $offset; $out .= '<div class="post_grid_image" data-style="width:' . $load_width . 'px;">'; ob_start(); miss_portfolio_image_begin(); $out .= ob_get_clean(); if (empty($img[0]) && !empty($_featured_video[$id])) { $video_check = miss_video($args = array('url' => $_featured_video[$id], 'parse' => true, 'width' => $width, 'height' => $height)); } else { $video_check = false; } if (!empty($video_check)) { $out .= $video_check; } else { $out .= miss_display_image(array('src' => $img[0], 'alt' => '', 'title' => '', 'height' => $height, 'width' => $width, 'class' => 'hover_fade_js', 'link_to' => $link_to, 'img_class' => 'post_grid_image has_preview', 'link_class' => 'portfolio_img_load', 'prettyphoto' => empty($_post[$id][0]) ? true : false, 'group' => $img_group, 'preload' => false)); } ob_start(); miss_portfolio_image_end(array('column' => $column, 'disable' => $disable, 'date' => !empty($_date[$id]) ? $_date[$id] : '')); $out .= ob_get_clean(); $out .= '</div>'; } $out .= '<div class="first_layer color_frame">'; $out .= '<div class="second_layer sidebar_framed_caption">'; if (strpos($disable, 'title') === false) { $out .= '<div class="portfolio_item_title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></div>'; // $title = ( empty( $_more[$id][0] ) ) ? '<a href="' . esc_url( $url ) . '">' . get_the_title( $id ) . '</a>' : get_the_title( $id ); /* if( $column == 1 || $column == 2 ) $out .= '<h2 class="post_title">' . $title . '</h2>'; else $out .= '<h3 class="post_title">' . $title . '</h3>'; */ } if (strpos($disable, 'meta') === false) { $out .= '<div class="portfolio_item_meta">' . miss_post_meta_diferent(array('echo' => false)) . '</div>'; } /* if( ( !empty( $_date[$id] ) ) && ( strpos( $disable, 'date' ) === false ) ) $out .= apply_filters( 'miss_portfolio_date', '<p class="date">' . $_date[$id] . '</p>', array( 'column' => $column ) ); if( empty( $_more[$id][0] ) || !empty( $_link[$id] ) || !empty( $_teaser[$id] ) ) { $out .= '<div class="post_excerpt">'; $out .= ( ( !empty( $_teaser[$id] ) ) && ( strpos( $disable, 'excerpt' ) === false ) ) ? '<p>' . do_shortcode( $_teaser[$id] ) . '</p>' : ''; if( empty( $_more[$id][0] ) || !empty( $_link[$id] ) ) { $out .= '<p>'; */ /* if( ( empty( $_more[$id][0] ) ) && ( strpos( $disable, 'more' ) === false ) ) { $read_more = '<a href="' . esc_url( $url ) . '" class="post_more_link">' . __( 'Read More', MISS_TEXTDOMAIN ) . '</a> '; $out .= apply_filters( 'miss_portfolio_read_more', $read_more, esc_url( $url ) ); } if( ( !empty( $_link[$id] ) ) && ( strpos( $disable, 'visit' ) === false ) ) { $visit_site = '<a href="' . esc_url( $_link[$id] ) . '" class="post_more_link">' . __( 'Visit Site', MISS_TEXTDOMAIN ) . '</a>'; $out .= apply_filters( 'miss_portfolio_visit_site', $visit_site, esc_url( $_link[$id] ) ); } */ /* $out .= '</p>'; } $out .= '</div>'; } */ $out .= '</div><!-- /.second_layer-->'; $out .= '</div><!-- /.first_layer-->'; $out .= '</div>'; $out .= '</div><!-- /.portfolio_item -->'; if ($i % $column == 0) { $out .= '<div class="clearboth"></div>'; } $i++; } } $out .= '</div>'; $out .= strpos($disable, 'pagination') === false ? miss_pagenavi('', '', $portfolio_query) : ''; } else { $out .= __('No portfolio posts were found for the category selected.', MISS_TEXTDOMAIN); } if (is_numeric($offset) && strpos($disable, 'pagination') === false) { remove_filter('post_limits', 'my_post_limit'); } wp_reset_query(); //return '[raw]' . $out . '[/raw]'; return $out; }