function resize_img($args) { /*definición de valores por defecto*/ $thumb = null; $img_url = null; $width = null; $height = null; $print = true; if (!is_array($args)) { parse_str($args, $args); } extract($args); if (empty($thumb)) { $thumb = get_post_thumbnail_id(); if ($thumb == null && $img_url == null) { return; } } if (!$width && !$height) { $width = '100'; $height = '100'; } if ($img_url) { $image = vt_resize('', $img_url, $width, $height, true); } else { $image = vt_resize($thumb, '', $width, $height, true); } if ($print) { echo '<img src="' . $image[url] . '" width="' . $image[width] . '" height="' . $image[height] . '" alt="' . the_title('', '', false) . '" />'; } else { return $image; } }
/** * This method is used to display the output of the element. * * @return void */ function element() { $options = $this->data['options']; $element_size = zn_get_size('one-third'); echo '<div class="th-image-gallery ' . $this->data['uid'] . ' ' . $this->opt('css_class', '') . '">'; if (!empty($options['ig_title'])) { echo '<div class="row">'; echo '<div class="col-sm-12">'; echo '<h4 class="th-image-gallery-title text-custom"><span class="th-image-gallery-title-sp">' . $options['ig_title'] . '</span></h4>'; echo '</div>'; echo '</div>'; } if (!empty($options['single_ig']) && is_array($options['single_ig'])) { $count = count($options['single_ig']); $i = 1; foreach ($options['single_ig'] as $image_arr) { if ($i % 3 == 1) { echo '<div class="row">'; } if (!empty($image_arr['sig_image'])) { $image = vt_resize('', $image_arr['sig_image'], $element_size['width'], '', true); echo '<div class="col-sm-4">'; echo '<a href="' . $image_arr['sig_image'] . '" class="hoverBorder" data-lightbox="image"><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt=""></a>'; echo '</div>'; } if ($i % 3 == 0 || $i == $count) { echo '</div>'; } $i++; } } echo '</div>'; }
/** * Process the upload. * * @since 1.0.0 */ public function handle_upload() { // Make sure all files are allowed if (!$this->check_file_type($_FILES['qqfile']['name'])) { return array('success' => false); } // if() // Get size and name if (!function_exists('wp_handle_upload')) { require_once ABSPATH . 'wp-admin/includes/file.php'; } $uploadedfile = $_FILES['qqfile']; $upload_overrides = array('test_form' => false); $movefile = wp_handle_upload($uploadedfile, $upload_overrides); if ($movefile) { $wp_upload_dir = wp_upload_dir(); $filename = str_replace($wp_upload_dir['url'] . '/', '', $movefile['url']); $attachment = $this->add_attachment($movefile['url'], $movefile['file']); $feat_image = wp_get_attachment_url($attachment); $img = vt_resize('', $feat_image, 200, 150, true); return array('success' => $movefile, 'attachmentId' => $attachment, 'attachment_url' => $img['url']); } else { return array('success' => false); } return array('success' => false); }
function _screenshoot_box($options) { ?> <div class="span12"> <div class="screenshot-box fixclear"> <div class="thescreenshot"> <div class="controls"><a href="#" class="prev"></a><a href="#" class="next"></a></div> <ul id="screenshot-carousel" class="fixclear zn_screenshot-carousel"> <?php if (!empty($options['ssb_imag_single']) && is_array($options['ssb_imag_single'])) { foreach ($options['ssb_imag_single'] as $image) { $image = vt_resize('', $image['ssb_single_screenshoot'], '580', '328', true); echo '<li><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt=""></li>'; } } ?> </ul> </div> <div class="left-side"> <h3 class="title"><?php echo $options['ssb_title']; ?> </h3> <?php if (!empty($options['ssb_feat_single']) && is_array($options['ssb_feat_single'])) { echo '<ul class="features">'; foreach ($options['ssb_feat_single'] as $feat) { echo '<li>'; // FEATURE TITLE if (!empty($feat['ssb_single_title'])) { echo '<h4>' . $feat['ssb_single_title'] . '</h4>'; } // FEATURE DESC if (!empty($feat['ssb_single_desc'])) { echo '<span>' . $feat['ssb_single_desc'] . '</span>'; } echo '</li>'; } echo '</ul>'; } // BUTTON LINK if (!empty($options['ssb_link_text']) && !empty($options['ssb_button_link']['url'])) { echo '<a href="' . $options['ssb_button_link']['url'] . '" target="' . $options['ssb_button_link']['target'] . '" class="btn btn-large btn-flat redbtn">' . $options['ssb_link_text'] . '</a>'; } ?> </div> </div><!-- end screenshot-box --> </div> <?php $screenshoot_box = array('zn_screenshoot_box' => "jQuery(window).load(function() {\n\t\t\t\t\t\t// ** Screenshots carousel\n\t\t\t\t\t\tjQuery('.zn_screenshot-carousel').carouFredSel({\n\t\t\t\t\t\t\tresponsive: true,\n\t\t\t\t\t\t\tscroll: { fx: \"crossfade\", duration: \"1500\" },\n\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\twidth: 580\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tauto: true,\n\t\t\t\t\t\t\tprev\t: {\t\n\t\t\t\t\t\t\t\tbutton\t: function(){return jQuery(this).closest('.thescreenshot').find('.prev');},\n\t\t\t\t\t\t\t\tkey\t\t: \"left\"\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnext\t: { \n\t\t\t\t\t\t\t\tbutton\t: function(){return jQuery(this).closest('.thescreenshot').find('.next');},\n\t\t\t\t\t\t\t\tkey\t\t: \"right\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// *** end Screenshots carousel\n\t\t\t\t\t\n\t\t\t\t});"); zn_update_array($screenshoot_box); }
function woocommerce_get_product_thumbnail($size = 'shop_catalog', $placeholder_width = 0, $placeholder_height = 0) { global $post, $woocommerce, $data; if (!$placeholder_width) { if (function_exists('wc_get_image_size')) { $placeholder_width = wc_get_image_size('shop_catalog_image_width'); } else { $placeholder_width = $woocommerce->get_image_size('shop_catalog_image_width'); } } if (!$placeholder_height) { if (function_exists('wc_get_image_size')) { $placeholder_height = wc_get_image_size('shop_catalog_image_height'); } else { $placeholder_height = $woocommerce->get_image_size('shop_catalog_image_height'); } } $output = '<div class="image">'; if (has_post_thumbnail()) { $width = '150'; $height = '130'; if (!empty($data['woo_cat_image_size'])) { $width = $data['woo_cat_image_size']['width']; $height = $data['woo_cat_image_size']['height']; } $image = vt_resize(get_post_thumbnail_id($post->ID), '', $width, $height, true); $output .= '<a href="' . get_permalink() . '"><img src="' . $image['url'] . '" alt=""></a>'; } else { $output .= '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="' . $placeholder_width . '" height="' . $placeholder_height . '" />'; } $output .= '</div>'; return $output; }
function _image_gallery($options) { $element_size = zn_get_size('one-third'); if (!empty($options['ig_title'])) { echo '<div class="span12">'; echo '<h4 class="smallm_title centered bigger"><span>' . $options['ig_title'] . '</span></h4>'; echo '</div>'; } if (!empty($options['single_ig']) && is_array($options['single_ig'])) { $count = count($options['single_ig']); $i = 1; foreach ($options['single_ig'] as $image_arr) { if ($i % 3 == 1) { echo '<div class="row-fluid zn_photo_gallery">'; } if (!empty($image_arr['sig_image'])) { $image = vt_resize('', $image_arr['sig_image'], $element_size['width'], '', true); echo '<div class="span4">'; echo '<a href="' . $image_arr['sig_image'] . '" class="hoverBorder" rel="prettyPhoto"><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt=""></a>'; echo '</div>'; } if ($i % 3 == 0 || $i == $count) { echo '</div>'; } $i++; } } echo '<div class="clear"></div>'; }
function _video_box($options) { $element_size = zn_get_size($options['_sizer']); ?> <div class="<?php echo $element_size['sizer']; ?> "> <?php if (!empty($options['vb_video_image']) && !empty($options['vb_video_url'])) { echo '<div class="adbox video">'; $image = vt_resize('', $options['vb_video_image'], $element_size['width'], '', true); echo '<img src="' . $image['url'] . '" alt="">'; echo '<div class="video_trigger_container">'; echo '<a class="playVideo" data-rel="prettyPhoto" href="' . $options['vb_video_url'] . '?width=80%&height=80%"></a>'; echo $options['vb_video_title']; echo '</div>'; echo '</div>'; } else { if (!empty($options['vb_video_url'])) { if (!empty($options['vb_video_title'])) { echo '<h4 class="m_title">' . $options['vb_video_title'] . '</h4>'; } echo get_video_from_link($options['vb_video_url'], '', $element_size['width'], $element_size['height']); } } ?> </div> <?php }
function wd_get_resized_url($id, $width, $height, $crop, $get_sizes = false) { if (function_exists("gd_info") && ($width >= 10 && $height >= 10) && ($width <= 1024 && $height <= 1024)) { $vt_image = vt_resize($id, '', $width, $height, $crop); if ($vt_image) { if ($get_sizes) { $image_url = $vt_image; } else { $image_url = $vt_image['url']; } } else { $image_url = false; } } else { $full_image = wp_get_attachment_image_src($id, 'full'); if (!empty($full_image[0])) { $image_url = $full_image[0]; } else { $image_url = false; } } if (is_ssl() && !strstr($image_url, 'https')) { str_replace('http', 'https', $image_url); } return $image_url; }
/** * This method is used to display the output of the element. * @return void */ function element() { $options = $this->data['options']; ?> <?php if (!empty($options['vb_video_image']) && !empty($options['vb_video_url'])) { echo '<div class="adbox video ' . $this->data['uid'] . ' ' . $this->opt('css_class', '') . '">'; $image = vt_resize('', $options['vb_video_image'], '', '', true); echo '<img class="adbox-img" src="' . $image['url'] . '" alt="">'; echo '<div class="video_trigger_wrapper">'; echo '<div class="adbox_container">'; echo '<a class="playVideo" data-lightbox="iframe" href="' . $options['vb_video_url'] . '"></a>'; if (isset($options['vb_video_title']) && !empty($options['vb_video_title'])) { echo '<h5 class="adbox-title kl-font-alt">' . $options['vb_video_title'] . '</h5>'; } echo '</div>'; echo '</div>'; // close video_trigger_container echo '</div>'; // close adbox } else { if (!empty($options['vb_video_url'])) { if (!empty($options['vb_video_title'])) { echo '<h4 class="m_title text-custom">' . $options['vb_video_title'] . '</h4>'; } echo get_video_from_link($options['vb_video_url'], '', '', ''); } } ?> <?php }
function _photo_gallery($options) { $element_size = zn_get_size($options['_sizer']); ?> <div class="<?php echo $element_size['sizer']; ?> "> <div class="row-fluid zn_image_gallery"> <?php if (!empty($options['single_photo_gallery']) && is_array($options['single_photo_gallery'])) { $i = 0; $id = uniqid('pp_'); $count = count($options['single_photo_gallery']); if (!empty($options['pg_num_cols'])) { $num_cols = $options['pg_num_cols']; } else { $num_cols = 6; } $new_size = 12 / $num_cols; $size = zn_get_size('span' . $new_size); $height = $image_resized['height']; if (isset($options['pg_img_height']) && !empty($options['pg_img_height'])) { $height = $options['pg_img_height']; } foreach ($options['single_photo_gallery'] as $image) { if ($i % $num_cols == 0) { echo '<div class="row-fluid">'; } //preg_match('|\d+|', 'span12' , $new_size); echo '<div class="span' . $new_size . '">'; if (!empty($image['spg_image']) && !empty($image['spg_video'])) { $image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true); echo '<a rel="prettyPhoto[' . $id . ']" href="' . $image['spg_video'] . '" title="' . $image['spg_title'] . '" class="hoverBorder">'; echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">'; echo '</a>'; } elseif (!empty($image['spg_image'])) { $image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true); echo '<a rel="prettyPhoto[' . $id . ']" href="' . $image['spg_image'] . '" title="' . $image['spg_title'] . '" class="hoverBorder">'; echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">'; echo '</a>'; } $i++; if ($i % $num_cols == 0 || $count == $i) { echo '</div>'; } echo '</div>'; } } ?> </div> </div> <?php }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); $categories = empty($instance['categories']) ? $instance['categories'] : implode($instance['categories'], ','); $count = empty($instance['count']) ? 5 : $instance['count']; $limit = empty($instance['limit']) ? 100 : $instance['limit']; $show_thumbnails = $instance['show_thumbnails']; $show_excerpt = $instance['show_excerpt']; $all_post_formats = $instance['all_post_formats']; $thumb_width = empty($instance['thumb_width']) ? 50 : $instance['thumb_width']; $thumb_height = empty($instance['thumb_height']) ? 50 : $instance['thumb_height']; //remove aside and quote post formats from the list $postargs = $all_post_formats ? array('orderby' => 'comment_count', 'post_type' => 'post', 'showposts' => $count, 'cat' => $categories, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1) : array('orderby' => 'comment_count', 'tax_query' => array(array('operator' => 'NOT IN', 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array('post-format-quote', 'post-format-aside'))), 'post_type' => 'post', 'showposts' => $count, 'cat' => $categories, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1); $post_query = new WP_Query($postargs); $rt_posts = '<div class="recent_posts clearfix"><ul>'; if ($post_query->have_posts()) { while ($post_query->have_posts()) { $post_query->the_post(); $post_title = get_the_title(); $link = get_permalink(); $date = get_the_time('d M Y'); $comment_count = get_comment_count($post_query->post->ID); $rt_gallery_images = get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_images", true) ? get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_images", true) : ""; $rt_gallery_image_titles = get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_titles", true) ? get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_titles", true) : ""; $rt_gallery_image_descs = get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_descs", true) ? get_post_meta($post_query->post->ID, THEMESLUG . "rt_gallery_image_descs", true) : ""; $fist_featured_image = is_array($rt_gallery_images) ? find_image_org_path($rt_gallery_images[0]) : ""; $rt_posts .= '<li class="clearfix">'; if ($fist_featured_image && !$show_thumbnails) { $f_image = @vt_resize('', $fist_featured_image, $thumb_width, $thumb_height, true); if ($f_image["url"]) { $rt_posts .= '<img src="' . $f_image["url"] . '" alt="' . $title . '" class="recent-posts-thumb" />'; } } $rt_posts .= '<span class="date">' . $date . '</span>'; $rt_posts .= '<span class="title"><a href="' . $link . '">' . $post_title . '</a></span>'; $rt_posts .= $show_excerpt ? '' . wp_html_excerpt(get_the_excerpt(), $limit) . '...' : ""; if ($comment_count['approved'] > 0) { if ($comment_count['approved'] > 1) { $comments = $comment_count['approved'] . ' ' . __('Comments', 'rt_theme'); } else { $comments = __('1 Comment', 'rt_theme'); } $rt_posts .= ' <span class="comment_number date"><a href="' . get_comments_link() . '" title="' . $comments . '" class="comment_link">' . $comments . '</a></span>'; $rt_posts .= $show_excerpt ? '<div class="space margin-b10"></div>' : ""; } $rt_posts .= '</li>'; } } wp_reset_query(); $rt_posts .= '</ul></div>'; echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo $rt_posts; echo $after_widget; }
function video_lightbox($post_id, $img_width, $img_height) { $video = get_post_meta($post_id, 'portfolio_video', true); $thumb = get_post_thumbnail_id(); $image = vt_resize($thumb, '', $img_width, $img_height, true); if ($video['vimeo-youtube'] != '') { echo '<a href="' . $video['vimeo-youtube'] . '" rel="prettyPhoto[gallery]" title=""><img src="' . $image[url] . '" alt="' . the_title('', '', false) . '" /></a>'; } else { echo '<a href="#inline-' . $post_id . '" rel="prettyPhoto[gallery]"><img src="' . $image[url] . '" alt="' . the_title('', '', false) . '" /></a><div id="inline-' . $post_id . '" class="hide">' . $video['embedded-code'] . '</div>'; } }
function _icarousel($options) { if (isset($options['ic_header_style']) && !empty($options['ic_header_style']) && $options['ic_header_style'] != 'zn_def_header_style') { $style = 'uh_' . $options['ic_header_style']; } else { $style = 'zn_def_header_style'; } ?> <div id="slideshow" class="<?php echo $style; ?> "> <div class="bgback"></div> <div class="carousel-container"> <div id="icarousel"> <?php if (isset($options['single_icarousel']) && is_array($options['single_icarousel'])) { foreach ($options['single_icarousel'] as $slide) { $link_start = '<a href="#" class="slide">'; $link_end = '</a>'; $slide_class = 'class="slide"'; if (isset($slide['ic_slide_link']['url']) && !empty($slide['ic_slide_link']['url'])) { // Set defaults $link_start = '<a class="slide" href="' . $slide['ic_slide_link']['url'] . '" target="' . $slide['ic_slide_link']['target'] . '">'; $link_end = '</a>'; $slide_class = ''; } echo $link_start; if (isset($slide['ic_slide_image']) && !empty($slide['ic_slide_image'])) { $image = vt_resize('', $slide['ic_slide_image'], '480', '360', true); echo '<img ' . $slide_class . ' src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" />'; } if (isset($slide['ic_slide_title']) && !empty($slide['ic_slide_title'])) { echo '<h5><span>' . $slide['ic_slide_title'] . '</span></h5>'; } echo $link_end; } } ?> </div> </div> </div><!-- end slideshow --> <?php // Load JS and CSS wp_enqueue_style('icarousel_demo'); wp_enqueue_style('icarousel'); wp_enqueue_script('icarousel'); wp_enqueue_script('mousewheel'); wp_enqueue_script('raphael_min'); $icarousel = array('zn_icarousel_slider' => "\t\n\t\t\t\t\t\t\t\tjQuery('#icarousel').iCarousel({\n\t\t\t\t\t\t\t\t\teasing: 'easeInOutQuint',\n\t\t\t\t\t\t\t\t\tslides: 7,\n\t\t\t\t\t\t\t\t\tanimationSpeed: 700,\n\t\t\t\t\t\t\t\t\tpauseTime: 5000,\n\t\t\t\t\t\t\t\t\tperspective: 75,\n\t\t\t\t\t\t\t\t\tslidesSpace: 300,\n\t\t\t\t\t\t\t\t\tpauseOnHover: true,\n\t\t\t\t\t\t\t\t\tdirection: \"ltr\",\n\t\t\t\t\t\t\t\t\ttimer: \"Bar\",\n\t\t\t\t\t\t\t\t\ttimerOpacity: 0.4,\n\t\t\t\t\t\t\t\t\ttimerDiameter: 220,\n\t\t\t\t\t\t\t\t\tkeyboardNav: true,\n\t\t\t\t\t\t\t\t\tmouseWheel: true,\n\t\t\t\t\t\t\t\t\ttimerPadding: 3,\n\t\t\t\t\t\t\t\t\ttimerStroke: 4,\n\t\t\t\t\t\t\t\t\ttimerBarStroke: 0,\n\t\t\t\t\t\t\t\t\ttimerColor: \"#FFF\",\n\t\t\t\t\t\t\t\t\ttimerPosition: \"bottom-center\",\n\t\t\t\t\t\t\t\t\ttimerX: 15,\n\t\t\t\t\t\t\t\t\ttimerY: 30\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t;"); zn_update_array($icarousel); }
/** * This method is used to display the output of the element. * * @return void */ function element() { $options = $this->data['options']; $uid = $this->data['uid']; $resize_method = $this->opt('ib2_resize_method', 'default'); echo '<div class="offer-banners ob--resize-' . $resize_method . ' ' . $uid . ' ' . $this->opt('css_class', '') . '">'; if (!empty($options['image_box_title'])) { echo '<h3 class="m_title m_title_ext text-custom offer-banners-title">' . $options['image_box_title'] . '</h3>'; } if (!empty($options['ib2_single']) && is_array($options['ib2_single'])) { echo '<div class="row">'; foreach ($options['ib2_single'] as $simage) { if ($slide_image = $simage['ib2_image']) { $saved_alt = $saved_title = ''; if (is_array($slide_image)) { // Get the saved image $saved_image = $slide_image['image']; if (!empty($slide_image['alt'])) { $saved_alt = $slide_image['alt']; } if (!empty($slide_image['title'])) { $saved_title = 'title="' . $slide_image['title'] . '"'; } } else { $saved_image = $slide_image; } $element_size = zn_get_size($simage['ib2_width']); echo '<div class="' . $element_size['sizer'] . '">'; $ib2_link = zn_extract_link($simage['ib2_link'], 'offer-banners-link hoverBorder', false, false, false, '#'); echo $ib2_link['start']; if ($resize_method == 'default') { $image = vt_resize('', $saved_image, $element_size['width'], '', true); echo '<img src="' . $image['url'] . '" height="' . $image['height'] . '" width="' . $image['width'] . '" alt="' . $saved_alt . '" ' . $saved_title . ' class="img-responsive offer-banners-img" />'; } else { if ($resize_method == 'cover') { $imgheight = isset($simage['ib2_image_height']) && !empty($simage['ib2_image_height']) ? $simage['ib2_image_height'] : 330; echo '<div class="offer-banners-img hoverborder-img" style="background-image:url(' . $saved_image . '); height:' . $imgheight . 'px;"></div>'; } else { if ($resize_method == 'no-resize') { echo '<img src="' . $saved_image . '" alt="' . $saved_alt . '" ' . $saved_title . ' class="img-responsive offer-banners-img" />'; } } } echo $ib2_link['end']; echo '</div>'; } } echo '</div>'; } echo "</div>"; }
/** * This method is used to display the output of the element. * @return void */ function element() { $options = $this->data['options']; ?> <div class="photo-gallery zn_image_gallery row <?php echo $this->data['uid']; ?> <?php echo $this->opt('css_class', ''); ?> "> <?php if (!empty($options['single_photo_gallery']) && is_array($options['single_photo_gallery'])) { $id = uniqid('pp_'); $num_cols = 6; if (!empty($options['pg_num_cols'])) { $num_cols = $options['pg_num_cols']; } $new_size = 12 / $num_cols; $size = zn_get_size('span' . $new_size); global $image_resized; $height = $image_resized['height']; if (isset($options['pg_img_height']) && !empty($options['pg_img_height'])) { $height = $options['pg_img_height']; } foreach ($options['single_photo_gallery'] as $image) { echo '<div class="col-xs-6 col-sm-4 col-lg-' . $new_size . ' u-mb-20">'; echo '<div class="mfp-gallery mfp-gallery--misc">'; // If Video // If Image if (!empty($image['spg_image']) && !empty($image['spg_video'])) { $image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true); echo '<a data-lightbox="mfp" data-mfp="iframe" href="' . $image['spg_video'] . '?width=100%&height=100%" title="' . $image['spg_title'] . '" class="hoverBorder">'; echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">'; echo '</a>'; } elseif (!empty($image['spg_image'])) { $image_resized = vt_resize('', $image['spg_image'], $size['width'], $height, true); echo '<a data-lightbox="mfp" data-mfp="image" href="' . $image['spg_image'] . '" title="' . $image['spg_title'] . '" class="hoverBorder">'; echo '<img alt="" src="' . $image_resized['url'] . '" width="' . $image_resized['width'] . '" height="' . $image_resized['height'] . '">'; echo '</a>'; } elseif (!empty($image['spg_video'])) { echo '<a class="playVideo" data-lightbox="mfp" data-mfp="iframe" href="' . $image['spg_video'] . '?width=100%&height=100%"></a>'; } echo '</div>'; echo '</div>'; } } ?> </div> <?php }
function _fancyslider($options) { ?> <div id="slideshow" class=""> <div class="container"> <div class="flexslider zn_fancy_slider"> <ul class="slides"> <?php if (isset($options['single_fancy']) && is_array($options['single_fancy'])) { foreach ($options['single_fancy'] as $slide) { $link_start = ''; $link_end = ''; if (isset($slide['ww_slide_link']['url']) && !empty($slide['ww_slide_link']['url'])) { // Set defaults $link_start = '<a class="link" href="' . $slide['ww_slide_link']['url'] . '" target="' . $slide['ww_slide_link']['target'] . '">'; $link_end = '</a>'; } echo '<li data-color="' . $slide['ww_slide_color'] . '">'; echo $link_start; if (isset($slide['ww_slide_image']) && !empty($slide['ww_slide_image'])) { $image = vt_resize('', $slide['ww_slide_image'], '940', '', true); echo '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" />'; } echo $link_end; echo '</li>'; } } ?> </ul> </div><!-- end #flexslider --> </div> <div class="shadowUP"></div> <div class="shadowUP"></div> </div><!-- end slideshow --> <?php // LOAD CSS AND JS wp_enqueue_style('flex_slider_fancy'); wp_enqueue_script('flex_slider'); wp_enqueue_script('flex_slider_colors'); $zn_fancy_slider = array('zn_fancy_slider' => "\n\t\t\t\t(function(\$) {\n\t\t\t\t\t\$(window).load(function(){\n\t\t\t\t\t\tfunction slideCompleteFancy(args) {\n\t\t\t\t\t\t\t//console.log(args);\n\t\t\t\t\t\t\tvar _arg = \$(args),\n\t\t\t\t\t\t\t\tslideshow = _arg.closest('#slideshow'),\n\t\t\t\t\t\t\t\tcolor = \$(args.slides).eq(args.animatingTo).attr('data-color');\n\t\t\t\t\t\t\t\tconsole.log(color)\n\t\t\t\t\t\t\tif( _arg.css('background-image') != 'none') _arg.css('background-image', 'none');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tslideshow.animate({backgroundColor: color}, 400);\n\t\t\t\t\t\t\t//slideshow.css({'background-color': color});\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\$(\".flexslider.zn_fancy_slider\").flexslider({\n\t\t\t\t\t\t\tanimation: \"slide\",\t\t\t\t//String: Select your animation type, \"fade\" or \"slide\"\n\t\t\t\t\t\t\tdirection: \"vertical\",\t\t\t//String: Select the sliding direction, \"horizontal\" or \"vertical\"\n\t\t\t\t\t\t\tslideshow: true,\t\t\t\t//Boolean: Animate slider automatically\n\t\t\t\t\t\t\tslideshowSpeed: 7000,\t\t\t//Integer: Set the speed of the slideshow cycling, in milliseconds\n\t\t\t\t\t\t\tanimationDuration: 600,\t\t\t//Integer: Set the speed of animations, in milliseconds\n\t\t\t\t\t\t\tdirectionNav: true,\t\t\t\t//Boolean: Create navigation for previous/next navigation? (true/false)\n\t\t\t\t\t\t\tcontrolNav: true,\t\t\t\t//Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage\n\t\t\t\t\t\t\tkeyboardNav: true,\t\t\t\t//Boolean: Allow slider navigating via keyboard left/right keys\n\t\t\t\t\t\t\tmousewheel: false,\t\t\t\t//{UPDATED} Boolean: Requires jquery.mousewheel.js (https://github.com/brandonaaron/jquery-mousewheel) - Allows slider navigating via mousewheel\n\t\t\t\t\t\t\tsmoothHeight: true,\n\t\t\t\t\t\t\trandomize: false,\t\t\t\t//Boolean: Randomize slide order\n\t\t\t\t\t\t\tslideToStart: 0,\t\t\t\t//Integer: The slide that the slider should start on. Array notation (0 = first slide)\n\t\t\t\t\t\t\tanimationLoop: true,\t\t\t//Boolean: Should the animation loop? If false, directionNav will received \"disable\" classes at either end\n\t\t\t\t\t\t\tpauseOnAction: true,\t\t\t//Boolean: Pause the slideshow when interacting with control elements, highly recommended.\n\t\t\t\t\t\t\tpauseOnHover: false,\t\t\t//Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering\n\t\t\t\t\t\t\tstart: slideCompleteFancy,\n\t\t\t\t\t\t\tbefore: slideCompleteFancy\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t})(jQuery);\n\t\t\t"); zn_update_array($zn_fancy_slider); }
function _testimonial_box($options) { $element_size = zn_get_size($options['_sizer']); $style = 'light'; $align = "left"; if ($options['tb_style'] == 'style2') { $style = 'dark'; $align = "top"; } ?> <div class="<?php echo $element_size['sizer']; ?> " > <div class="testimonial_box" data-align="<?php echo $align; ?> " data-theme="<?php echo $style; ?> "> <div class="details"> <?php if (!empty($options['tb_author_logo'])) { $image = vt_resize('', $options['tb_author_logo'], '60', '60', true); echo '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt="">'; } if (!empty($options['tb_author']) || !empty($options['tb_author_com'])) { echo '<h6>'; if (!empty($options['tb_author'])) { echo '<strong>' . $options['tb_author'] . '</strong>'; } if (!empty($options['tb_author_com'])) { echo $options['tb_author_com']; } echo '</h6>'; } ?> </div> <?php if (!empty($options['tb_author_quote'])) { echo '<blockquote>' . $options['tb_author_quote'] . '</blockquote>'; } ?> </div> </div> <?php }
function _image_box2($options) { if (!empty($options['image_box_title'])) { echo '<div class="span12 offer-banners">'; echo '<h3 class="m_title">' . $options['image_box_title'] . '</h3>'; echo '</div>'; } if (!empty($options['ib2_single']) && is_array($options['ib2_single'])) { foreach ($options['ib2_single'] as $simage) { if ($slide_image = $simage['ib2_image']) { if (is_array($slide_image)) { // Get the saved image $saved_image = $slide_image['image']; if (!empty($slide_image['alt'])) { $saved_alt = 'alt="' . $slide_image['alt'] . '"'; } else { $saved_alt = ''; } if (!empty($slide_image['title'])) { $saved_title = 'title="' . $slide_image['title'] . '"'; } else { $saved_title = ''; } } else { $saved_image = $slide_image; $saved_alt = ''; $saved_title = ''; } echo '<div class="' . $simage['ib2_width'] . ' offer-banners">'; $element_size = zn_get_size($simage['ib2_width']); $image = vt_resize('', $saved_image, $element_size['width'], '', true); $link_start = '<a href="#" class="hoverBorder">'; $link_end = '</a>'; if (!empty($simage['ib2_link']['url'])) { $link_start = '<a href="' . $simage['ib2_link']['url'] . '" target="' . $simage['ib2_link']['target'] . '" class="hoverBorder">'; $link_end = '</a>'; } echo $link_start; echo '<img src="' . $image['url'] . '" height="' . $image['height'] . '" width="' . $image['width'] . '" ' . $saved_alt . ' ' . $saved_title . ' />'; echo $link_end; echo '</div>'; } } } }
/** * This method is used to display the output of the element. * @return void */ function element() { $options = $this->data['options']; $elm_classes = array(); $elm_classes[] = $this->data['uid']; $elm_classes[] = $this->opt('css_class', ''); $color_scheme = $this->opt('element_scheme', '') == '' ? zget_option('zn_main_style', 'color_options', false, 'light') : $this->opt('element_scheme', ''); $elm_classes[] = 'tstsld--' . $color_scheme; $elm_classes[] = 'element-scheme--' . $color_scheme; echo '<div class="testimonials-carousel tst-carousel ' . implode(' ', $elm_classes) . '">'; if (!empty($options['tf_title'])) { echo '<h3 class="m_title m_title_ext text-custom tst-carousel-elm-title">' . $options['tf_title'] . '</h3>'; } echo '<div class="controls tst-carousel-controls">'; echo '<a href="#" class="prev tst-carousel-controls-arr"><span class="glyphicon glyphicon-chevron-left"></span></a>'; echo '<a href="#" class="next tst-carousel-controls-arr"><span class="glyphicon glyphicon-chevron-right"></span></a>'; echo '</div>'; if (!empty($options['testimonials_slider_single']) && is_array($options['testimonials_slider_single'])) { // Speed $speed = 5000; if (!empty($options['tf_speed'])) { $speed = intval($options['tf_speed']); } echo '<ul class="zn_testimonials_carousel tst-carousel-list fixclear" data-speed="' . $speed . '" data-autoplay="' . $this->opt('tf_autoplay', 1) . '">'; foreach ($options['testimonials_slider_single'] as $test) { if (!empty($test['tf_single_test'])) { echo '<li class="tst-carousel-item">'; echo '<blockquote class="tst-carousel-bqt">' . do_shortcode($test['tf_single_test']) . '</blockquote>'; echo '<div class="testimonial-author tst-carousel-author">'; if (isset($test['ts_author_photo']) && !empty($test['ts_author_photo'])) { echo '<div class="testimonial-author--photo tst-carousel-photo">'; $image = vt_resize('', $test['ts_author_photo'], '40', '40', true); echo '<img class="tst-carousel-img" src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt="">'; echo '</div>'; } echo '<h5 class="tst-carousel-title">' . $test['tf_single_author'] . '</h5>'; echo '</div>'; echo '</li>'; } } echo '</ul>'; } echo '</div>'; }
function theme_resized_image_path($atts, $content = null) { global $themePath; extract(shortcode_atts(array('w' => '0', 'h' => '0', 'image' => false, 'return' => 'url'), $atts)); $image = trim($image); if ($image) { // crop image (default = true) $crop = strval($w) === '0' || strval($h) === '0' ? false : true; // Setting to FALSE is useful when setting one value so other adjusts automatically // Check for special requests (featured image, etc.) if ($image == 'featured') { $image = get_post_thumbnail_id(); } // get resized image (if given media ID or URL) // this will return the resized $thumb or placeholder if enabled and no $thumb if (wp_get_attachment_url($image)) { // Looks like we were given an ID $img = vt_resize($image, '', $w, $h, $crop); } else { // Must be an image path $img = vt_resize('', $image, $w, $h, $crop); } // return... if ($return == 'array') { // Return the entire image array return $img; } else { // Return the image URL return $img['url']; } } }
function _recent_work2($options) { $element_size = zn_get_size($options['_sizer']); ?> <div class="recentwork_carousel style2 <?php echo $element_size['sizer']; ?> "> <?php // ELEMENT TITLE if (!empty($options['rw_title'])) { echo '<h3 class="m_title">' . $options['rw_title'] . '</h3>'; } ?> <div class="controls"> <a href="#" class="prev"><span class="icon-chevron-left"></span></a> <?php // PORTFOLIO PAGE LINK if (!empty($options['rw_port_link'])) { echo '<a href="' . $options['rw_port_link'] . '" class="complete"><span class="icon-th"></span></a>'; } ?> <a href="#" class="next"><span class="icon-chevron-right"></span></a> </div> <ul id="recent_works2" class="fixclear recent_works2"> <?php global $post; $posts_per_page = isset($options['ports_per_page']) ? $options['ports_per_page'] : '4'; // how many posts // Start the query query_posts(array('post_type' => 'portfolio', 'posts_per_page' => $posts_per_page, 'tax_query' => array(array('taxonomy' => 'project_category', 'field' => 'id', 'terms' => $options['portfolio_categories'])))); // Start the loop while (have_posts()) { the_post(); // Get post meta information $post_meta_fields = get_post_meta($post->ID, 'zn_meta_elements', true); $post_meta_fields = maybe_unserialize($post_meta_fields); echo '<li>'; echo '<a href="' . get_permalink() . '">'; if (!empty($post_meta_fields['port_media']) && is_array($post_meta_fields['port_media'])) { $size = zn_get_size('four'); $has_image = false; if ($portfolio_image = $post_meta_fields['port_media']['0']['port_media_image_comb']) { if (is_array($portfolio_image)) { if ($saved_image = $portfolio_image['image']) { if (!empty($portfolio_image['alt'])) { $saved_alt = 'alt="' . $portfolio_image['alt'] . '"'; } else { $saved_alt = ''; } if (!empty($portfolio_image['title'])) { $saved_title = 'title="' . $portfolio_image['title'] . '"'; } else { $saved_title = ''; } $has_image = true; } } else { $saved_image = $portfolio_image; $has_image = true; $saved_alt = ''; $saved_title = ''; } if ($has_image) { $image = vt_resize('', $saved_image, $size['width'], '169', true); } } // Check to see if we have video if ($portfolio_media = $post_meta_fields['port_media']['0']['port_media_video_comb']) { } // IMAGE if (!empty($saved_image)) { echo '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" ' . $saved_alt . ' ' . $saved_title . ' />'; } elseif ($portfolio_media) { echo get_video_from_link($portfolio_media, '', $size['width'], '169'); } } echo '<div class="details">'; echo '<span class="plus">+</span>'; // GET THE POST TITLE echo '<h4>' . get_the_title() . '</h4>'; // GET ALL POST CATEGORIES echo '<span>' . strip_tags(get_the_term_list($post->ID, 'project_category', '', ' , ', '')) . '</span>'; echo '</div>'; echo '</a>'; echo '</li>'; } wp_reset_query(); ?> </ul> </div><!-- end row // recentworks_carousel default-style --> <?php $zn_recent_works2 = array('zn_recent_works2' => "\n\t\t\t\t\t\t\tjQuery(window).load(function(){\n\t\t\t\t\t\t\t\tjQuery('.recent_works2').carouFredSel({\n\t\t\t\t\t\t\t\t\tresponsive: true,\n\t\t\t\t\t\t\t\t\tscroll: 1,\n\t\t\t\t\t\t\t\t\tauto: false,\n\t\t\t\t\t\t\t\t\titems: {\n\t\t\t\t\t\t\t\t\t\twidth: 400,\n\t\t\t\t\t\t\t\t\t\tvisible: {\n\t\t\t\t\t\t\t\t\t\t\tmin: 4,\n\t\t\t\t\t\t\t\t\t\t\tmax: 10\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tprev\t: {\t\n\t\t\t\t\t\t\t\t\t\tbutton\t: function(){return jQuery(this).closest('.recentwork_carousel').find('.prev');},\n\t\t\t\t\t\t\t\t\t\tkey\t\t: \"left\"\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tnext\t: { \n\t\t\t\t\t\t\t\t\t\tbutton\t: function(){return jQuery(this).closest('.recentwork_carousel').find('.next');},\n\t\t\t\t\t\t\t\t\t\tkey\t\t: \"right\"\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// *** end recent works carousel"); zn_update_array($zn_recent_works2); }
?> <li> <?php $lbtitle = get_post_meta(get_the_id(), "_lbtitle", true); $url = get_post_meta(get_the_id(), "_lburl", true); $thumb = get_post_thumbnail_id(); if ($cols == "0" || $cols == "") { $image = vt_resize($thumb, '', 390, 240, true, 70); } elseif ($cols == "One Column") { $image = vt_resize($thumb, '', 390, 240, true, 70); } elseif ($cols == "Two Columns") { $image = vt_resize($thumb, '', 390, 240, true, 70); } elseif ($cols == "Three Columns") { $image = vt_resize($thumb, '', 250, 170, true, 70); } elseif ($cols == "Four Columns") { $image = vt_resize($thumb, '', 190, 130, true, 70); } ?> <?php echo '<a href="' . $url . '" rel="prettyPhoto"><img src="' . $image[url] . '" width="' . $image[width] . '" height="' . $image[height] . '" alt="' . $lbtitle . '" /></a>'; ?> </li> <?php } ?> </ul> </div> <?php wp_pagenavi(); ?>
/** * * Get resized image * */ public function getResizedImage($params) { global $_wp_additional_image_sizes; // Some variables we'll need $defaults = array('image_size' => 'medium', 'id' => false, 'post_id' => false); $params = array_merge($defaults, $params); $resizedImage = $fullImage = $alt = ''; // Get variables from the $params array extract($params); // Check if a post ID was supplied if ($post_id && !$id) { $id = get_post_thumbnail_id($post_id); } // We must have an ID for the media file if (!$id) { return; } // Grab the large image for later $largeImage = wp_get_attachment_image_src($id, 'large'); // See if WP already has a resized image matching what we want if (is_string($image_size) && (!empty($_wp_additional_image_sizes[$image_size]) && is_array($_wp_additional_image_sizes[$image_size]) || in_array($image_size, array('thumbnail', 'thumb', 'medium', 'large', 'full')))) { $fullImage = wp_get_attachment_image($id, $image_size); } // We didn't find an existing image at the needed size so we need to create a new one if ($fullImage == '' && $id) { // Get the full image tag for the medium image, just in case... $fullImage = wp_get_attachment_image($id, 'medium'); // Resize image to custom size if (function_exists('vt_resize') && is_string($image_size)) { // Clean up the image size data to get the dimensions. $size = str_replace(array('px', ' ', '*', 'x'), array('', '', 'x', 'x'), strtolower($image_size)); $size = explode("x", $size); // Set width and height $width = isset($size[0]) ? $size[0] : 0; $height = isset($size[1]) ? $size[1] : 0; $crop = $width == 0 || $height == 0 ? false : true; // Resize the image $resizedImage = vt_resize($id, '', $width, $height, $crop); // Find the alt text associated with this media file $alt = trim(strip_tags(get_post_meta($id, '_wp_attachment_image_alt', true))); } else { // Oh bother! We don't have a reize function to use. } // Make sure we have alternate text if (empty($alt)) { // No? Try the caption instead. $attachment = get_post($id); $alt = trim(strip_tags($attachment->post_excerpt)); if (empty($alt)) { // Still nothing!!? Ok, we'll use the post title. $alt = trim(strip_tags($attachment->post_title)); } } // Let's wrap this up and create a full image tag. if ($resizedImage) { // $resizedImage = '<img src="'.$p_img['url'].'" width="'.$p_img['width'].'" height="'.$p_img['height'].'" alt="'.$alt.'" />'; $fullImage = '<img src="' . $resizedImage['url'] . '" width="' . $resizedImage['width'] . '" height="' . $resizedImage['height'] . '" alt="' . $alt . '">'; } } return array('full_image_tag' => $fullImage, 'large_image' => $largeImage[0]); }
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $excats = get_option('ep_exclude_categories'); $args=array( 'cat'=> $excats, 'paged'=>$paged, ); query_posts($args); while (have_posts()) : the_post(); ?> <div class="post-layout post-<?php the_ID();?>"> <h2 class="post-title"><a href="<?php the_permalink();?>"><?php the_title();?></a></h2> <?php if(has_post_thumbnail()) { ?> <?php $post_thumb = get_post_thumbnail_id(); $post_image = vt_resize( $post_thumb,'' , 700, 220, true );?> <div class="post-image"> <a href="<?php the_permalink();?>" class="post-load"><img src="<?php echo $post_image[url]; ?>" width="<?php echo $post_image[width]; ?>" height="<?php echo $post_image[height]; ?>" alt="<?php the_title();?>" /></a> </div> <?php } else { ?> <?php } ?> <div class="post-content"> <?php global $more; $more = false; ?><?php the_excerpt(''); ?><?php $more = true; ?> </div> <div class="post-meta"> <ul class="post-meta-info"> <?php if (get_option('ep_blog_show_author') != 'false') { ?>
the_post(); ?> <!-- start post content --> <div class="blog_post"> <h2><?php the_title(); ?> </h2> <?php if (has_post_thumbnail()) { ?> <div class="post_thumbnail"> <?php $thumb = get_post_thumbnail_id(); $image = vt_resize($thumb, '', 530, 220, true, 70); ?> <img src="<?php echo $image[url]; ?> " width="<?php echo $image[width]; ?> " height="<?php echo $image[height]; ?> " class="front" /></a> </div> <?php } ?>
/** * This method is used to display the output of the element. * @return void */ function element() { $options = $this->data['options']; if (empty($options['testimonials_single'])) { return; } $elm_classes = array(); $elm_classes[] = $this->data['uid']; $elm_classes[] = $this->opt('css_class', ''); $color_scheme = $this->opt('element_scheme', '') == '' ? zget_option('zn_main_style', 'color_options', false, 'light') : $this->opt('element_scheme', ''); $elm_classes[] = 'tstfd--' . $color_scheme; $elm_classes[] = 'element-scheme--' . $color_scheme; $title_content = false; echo '<div class="row elm-testimonial-fader tst-fader ' . implode(' ', $elm_classes) . '">'; if (!empty($options['tf_title']) || !empty($options['tf_desc'])) { echo '<div class="col-sm-3">'; echo '<div class="testimonials_fader tst-fader-wrapper">'; if (!empty($options['tf_title'])) { echo '<h3 class="m_title m_title_ext text-custom tst-fader-title">' . $options['tf_title'] . '</h3>'; } if (!empty($options['tf_desc'])) { echo '<div class="tst-fader-desc">' . $options['tf_desc'] . '</div>'; } $show_controls = $this->opt('tf_controls', ''); if ($show_controls == '1') { echo '<div class="controls tst-fader-controls">'; echo '<a href="#" class="prev tst-fader-controls-arr"><span class="glyphicon glyphicon-chevron-left"></span></a>'; echo '<a href="#" class="next tst-fader-controls-arr"><span class="glyphicon glyphicon-chevron-right"></span></a>'; echo '</div>'; } echo '</div>'; echo '</div>'; $title_content = true; } // end if echo '<div class="col-sm-' . ($title_content ? 9 : 12) . '">'; // Speed $speed = 5000; if (!empty($options['tf_speed'])) { $speed = intval($options['tf_speed']); } echo '<ul class="fixclear testimonials_fader_trigger tst-fader-list ' . ($title_content ? 'has-left-border' : '') . '" data-speed="' . $speed . '" data-autoplay="' . $this->opt('tf_autoplay', 1) . '">'; foreach ($options['testimonials_single'] as $test) { echo '<li class="tst-fader-item">'; echo '<blockquote class="tst-fader-bqt">' . do_shortcode($test['tf_single_test']) . '</blockquote>'; echo '<div class="testimonial-author tst-fader-author clearfix">'; if (isset($test['tf_author_photo']) && !empty($test['tf_author_photo'])) { echo '<div class="testimonial-author--photo tst-fader-photo">'; $image = vt_resize('', $test['tf_author_photo'], '30', '30', true); echo '<img class="tst-fader-img" src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt="">'; echo '</div>'; } echo '<h6 class="tst-fader-author-title">' . $test['tf_single_author'] . '</h6>'; echo '</div>'; echo '</li>'; } echo '</ul>'; echo '</div>'; echo '</div>'; // end .row }
function _iosSlider($options) { if (isset($options['io_header_style']) && !empty($options['io_header_style'])) { $style = 'uh_' . $options['io_header_style']; } else { $style = ''; } if (isset($options['io_s_fade']) && !empty($options['io_s_fade'])) { $faded = 'faded'; } else { $faded = ''; } if (isset($options['io_s_scroll']) && !empty($options['io_s_scroll'])) { $scroll = 'slider_fixedd'; } else { $scroll = ''; } if (!empty($options['io_s_width'])) { $padded = 'notPadded'; $fluid_start = '<div class="fluidHeight"><div class="sliderContainer ">'; $fluid_end = '</div></div>'; $wid_fixed = 'fixed'; } else { $padded = ''; $fluid_start = ''; $fluid_end = ''; $wid_fixed = ''; } if (!empty($options['io_s_s_height']) && empty($options['io_s_width'])) { $s_height = 'style="padding:0 0 ' . $options['io_s_s_height'] . '% 0;overflow:hidden;"'; } else { $s_height = ''; } ?> <div id="slideshow" class="<?php echo $style; ?> <?php echo $faded; ?> <?php echo $padded; ?> <?php echo $scroll; ?> " <?php echo $s_height; ?> > <div class="bgback"></div> <div data-images="<?php echo IMAGES_URL; ?> /" id="sparkles"></div> <?php echo $fluid_start; ?> <div class = "iosSlider <?php echo $faded; ?> <?php echo $wid_fixed; ?> zn_slideshow"> <div class="slider"> <?php if (isset($options['single_iosslider']) && is_array($options['single_iosslider'])) { $thumbs = ''; $i = 0; $bullets = ''; foreach ($options['single_iosslider'] as $slide) { if ($i == 0) { $slide_num = 'first selected'; } else { $slide_num = ''; } $c_style = 'style1'; $c_pos = ''; $bullets .= '<div class="item ' . $slide_num . '"></div>'; echo '<div class = "item">'; $img_link_start = ''; $img_link_end = ''; if (!empty($slide['io_slide_link']['url']) && !empty($slide['io_slide_link_image']) && $slide['io_slide_link_image'] == 'yes') { $img_link_start = '<a class="zn_slide_image_link" href="' . $slide['io_slide_link']['url'] . '" target="' . $slide['io_slide_link']['target'] . '">'; $img_link_end = '</a>'; } // Slide Image if ($slide_image = $slide['io_slide_image']) { if (is_array($slide_image)) { $saved_image = $slide_image['image']; if (!empty($slide_image['alt'])) { $saved_alt = 'alt="' . $slide_image['alt'] . '"'; } else { $saved_alt = ''; } if (!empty($slide_image['title'])) { $saved_title = 'title="' . $slide_image['title'] . '"'; } else { $saved_title = ''; } } else { $saved_image = $slide_image; $saved_alt = ''; $saved_title = ''; } if ($options['io_s_width']) { $image = vt_resize('', $saved_image, '1170', '', true); echo $img_link_start . '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" ' . $saved_title . ' ' . $saved_alt . ' />' . $img_link_end; } else { echo $img_link_start . '<img src="' . $saved_image . '" ' . $saved_title . ' ' . $saved_alt . '/>' . $img_link_end; } if (isset($options['io_s_navigation']) && $options['io_s_navigation'] == 'thumbs') { $image = vt_resize('', $saved_image, '150', '60', true); $thumbs .= '<div class="item ' . $slide_num . '"><img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" ' . $saved_title . ' ' . $saved_alt . ' /></div>'; } } // Slide Caption Style if (isset($slide['io_slide_caption_style']) && !empty($slide['io_slide_caption_style'])) { $c_style = $slide['io_slide_caption_style']; } // Slide Caption Position if (isset($slide['io_slide_caption_pos']) && !empty($slide['io_slide_caption_pos'])) { $c_pos = $slide['io_slide_caption_pos']; } echo '<div class="caption ' . $c_style . ' ' . $c_pos . '">'; // Slide Main TITLE if (isset($slide['io_slide_m_title']) && !empty($slide['io_slide_m_title'])) { echo '<h2 class="main_title">' . $slide['io_slide_m_title'] . '</h2>'; } // Slide BIG TITLE if (isset($slide['io_slide_b_title']) && !empty($slide['io_slide_b_title'])) { echo '<h3 class="title_big">' . $slide['io_slide_b_title'] . '</h3>'; } if (!empty($slide['io_slide_link']['url']) && $slide['io_slide_caption_style'] != 'style3') { echo '<a class="more" href="' . $slide['io_slide_link']['url'] . '" target="' . $slide['io_slide_link']['target'] . '"><img width="10" height="16" src="' . MASTER_THEME_DIR . '/sliders/iosslider/arr01.png" alt=""></a>'; } // Slide SMALL TITLE if (isset($slide['io_slide_s_title']) && !empty($slide['io_slide_s_title'])) { echo '<h4 class="title_small">' . $slide['io_slide_s_title'] . '</h4>'; } echo $img_link_start . $img_link_end; echo '</div>'; echo '</div><!-- end item -->'; $i++; } } echo '</div>'; $infinite_slide = 'false'; if (count($options['single_iosslider']) > 1) { // This will fix the Ios Slider when using only one slide $infinite_slide = 'true'; echo '<div class="prev"><div class="btn-label">' . __('PREV', THEMENAME) . '</div></div>'; echo '<div class="next"><div class="btn-label">' . __('NEXT', THEMENAME) . '</div></div>'; if (!$options['io_s_width'] && $options['io_s_navigation'] == 'thumbs') { ?> <div class="selectorsBlock thumbs"> <a href="#" class="thumbTrayButton"><span class="icon-minus icon-white"></span></a> <div class="selectors"> <?php echo $thumbs; ?> </div> </div> <?php } echo '</div><!-- end iosSlider -->'; if ($options['io_s_width'] || $options['io_s_navigation'] != 'thumbs') { ?> <div class="selectorsBlock bullets"> <div class="selectors"> <?php echo $bullets; ?> </div> </div> <?php } } else { echo '</div><!-- end iosSlider -->'; } ?> <div class="scrollbarContainer"></div> <div class="zn_header_bottom_style"></div><!-- header bottom style --> <?php echo $fluid_end; ?> </div><!-- end slideshow --> <div class="zn_fixed_slider_fill"></div> <?php // Load CSS and JS wp_enqueue_style('ios_slider'); wp_enqueue_script('ios_slider_min'); wp_enqueue_script('ios_slider_kalypso'); $trans = '5000'; if (!empty($options['io_s_trans'])) { $trans = $options['io_s_trans']; } $ios_slider = array('zn_ios_slider' => "\t\n\t\t\t\tjQuery('.iosSlider').each(function(){\n\n\t\t\t\t\tjQuery(this).iosSlider({\n\t\t\t\t\t\tsnapToChildren: true,\n\t\t\t\t\t\tdesktopClickDrag: true,\n\t\t\t\t\t\tkeyboardControls: true,\n\t\t\t\t\t\tautoSlideTimer: " . $trans . ",\n\t\t\t\t\t\tnavNextSelector: jQuery(this).closest('.iosSlider').find('.next'),\n\t\t\t\t\t\tnavPrevSelector: jQuery(this).closest('.iosSlider').find('.prev'),\n\t\t\t\t\t\tnavSlideSelector: jQuery('.selectors .item'),\n\t\t\t\t\t\tscrollbar: true,\n\t\t\t\t\t\tscrollbarContainer: '#slideshow .scrollbarContainer',\n\t\t\t\t\t\tscrollbarMargin: '0',\n\t\t\t\t\t\tscrollbarBorderRadius: '4px',\n\t\t\t\t\t\tonSlideComplete: slideComplete,\n\t\t\t\t\t\tonSliderLoaded: function(args){\n\t\t\t\t\t\t\tvar otherSettings = {\n\t\t\t\t\t\t\t\thideControls : true, // Bool, if true, the NAVIGATION ARROWS will be hidden and shown only on mouseover the slider\n\t\t\t\t\t\t\t\thideCaptions : false // Bool, if true, the CAPTIONS will be hidden and shown only on mouseover the slider\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsliderLoaded(args, otherSettings);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonSlideChange: slideChange,\n\t\t\t\t\t\tkeyboardControls: true,\n\t\t\t\t\t\tinfiniteSlider: " . $infinite_slide . ",\n\t\t\t\t\t\tautoSlide: true\n\t\t\t\t\t});\n\n\t\t\t\t})\n\n\t\t\t;"); zn_update_array($ios_slider); }
while (have_posts()) { the_post(); $image_id = get_post_thumbnail_id($post->ID); $feat_image = wp_get_attachment_url(get_post_thumbnail_id($post->ID)); ?> <article id="post-<?php the_ID(); ?> " <?php post_class('col-lg-4 col-md-4'); ?> > <div class="entry-content"> <?php $img = vt_resize('', $feat_image, 350, 250, true); ?> <a href="<?php echo $feat_image; ?> " target="_blank"> <img src="<?php echo $img['url']; ?> " style="padding:10px" /></a> <input type="checkbox" name="mediid[]" value="<?php echo get_the_ID(); ?> " /> <?php
} if (!empty($portfolio_image['title'])) { $saved_title = 'title="' . $portfolio_image['title'] . '"'; } else { $saved_title = ''; } $has_image = true; } } else { $saved_image = $portfolio_image; $has_image = true; $saved_alt = ''; $saved_title = ''; } if ($has_image) { $image = vt_resize('', $saved_image, $size['width'], '', true); } } // Check to see if we have video $portfolio_media = $port_media[0]['port_media_video_comb']; // Display the media if (!empty($saved_image) && $portfolio_media) { echo '<a href="' . $portfolio_media . '" data-mfp="iframe" data-lightbox="iframe" class="portfolio-item-link hoverLink"></a>'; echo '<img class="kl-ptf-catlist-img" src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" alt="' . $saved_alt . '" ' . $saved_title . ' />'; echo '<div class="portfolio-item-overlay">'; echo '<div class="portfolio-item-overlay-inner">'; echo '<span class="portfolio-item-overlay-icon glyphicon glyphicon-play"></span>'; echo '</div>'; echo '</div>'; } elseif (!empty($saved_image)) { if (zget_option('zn_link_portfolio', 'portfolio_options', false, 'no') == 'yes') {
function bp_s3_get_custom_image_url($post_id, $width, $height, $crop = true) { $meta_key = "slide_image" . $height . "x" . $width; //we have a unique key like slide_image200x300; $image_url = get_post_meta($post_id, $meta_key, true); if (!empty($image_url)) { return $image_url; } //if we are here, the image was not generated and stored earlier, right $thumb = get_post_thumbnail_id($post_id); $image = vt_resize($thumb, '', $width, $height, $crop); if (!empty($image)) { $image_url = $image['url']; update_post_meta($post_id, $meta_key, $image_url); //store for later use } //if $image_ur, return it otherwise single post thumbnail if ($image_url) { return $image_url; } //else // return get_the_post_thumbnail( $post_id, 'single-post-thumbnail'); }