function userpro_get_avatar($avatar, $id_or_email, $size, $default, $alt = '') { global $userpro; require_once userpro_path . 'lib/BFI_Thumb.php'; if (isset($id_or_email->user_id)) { $id_or_email = $id_or_email->user_id; } elseif (is_email($id_or_email)) { $user = get_user_by('email', $id_or_email); $id_or_email = $user->ID; } if ($id_or_email && userpro_profile_data('profilepicture', $id_or_email)) { $url = $userpro->file_uri(userpro_profile_data('profilepicture', $id_or_email), $id_or_email); $params = array('width' => $size, 'height' => $size, 'quality' => 100); $crop = bfi_thumb(get_site_url() . (strpos($url, "http") !== false ? urlencode($url) : $url), $params); $return = '<img src="' . $crop . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="modified avatar" />'; } else { if ($id_or_email && userpro_profile_data('gender', $id_or_email)) { $gender = strtolower(userpro_profile_data('gender', $id_or_email)); } else { $gender = 'male'; // default gender } $userpro_default = userpro_url . 'img/default_avatar_' . $gender . '.jpg'; $return = '<img src="' . $userpro_default . '" width="' . $size . '" height="' . $size . '" alt="' . $alt . '" class="default avatar" />'; } if (userpro_profile_data('profilepicture', $id_or_email) != '') { return $return; } else { if (userpro_get_option('use_default_avatars') == 1) { return $avatar; } else { return $return; } } }
function get_bfithumb($w, $h, $url) { include_once 'includes/bfithumb.php'; $params = array('width' => $w, 'height' => $h, 'crop' => true); $image = bfi_thumb($url, $params); return $image; }
function st_vc_team($attr, $content = false) { $data = shortcode_atts(array('st_avatar' => 0, 'st_name' => 0, 'st_position' => '', 'st_position_social' => '-top-left', 'st_effect' => '', 'st_facebook' => '', 'st_twitter' => '', 'st_google' => '', 'st_other_social' => ''), $attr, 'st_team'); extract($data); $img = wp_get_attachment_image_src($st_avatar, 'full'); $list_social = ''; if (!empty($st_facebook)) { $list_social .= '<li><a href="' . $st_facebook . '" class="fa fa-facebook box-icon-normal round"></a></li>'; } if (!empty($st_twitter)) { $list_social .= '<li><a href="' . $st_twitter . '" class="fa fa-twitter box-icon-normal round"></a></li>'; } if (!empty($st_google)) { $list_social .= '<li><a href="' . $st_google . '" class="fa fa-google-plus box-icon-normal round"></a></li>'; } if (!empty($st_other_social)) { $list_social .= $st_other_social; } $txt = '<div class="thumb text-center st_team"> <header class="thumb-header hover-img"> <img class="round" src="' . bfi_thumb($img[0], array('width' => 300, 'height' => 300)) . '" alt="' . $st_name . '" title="' . $st_name . '" /> <ul class="hover-icon-group' . $st_position_social . ' ' . $st_effect . ' "> ' . $list_social . ' </ul> </header> <div class="thumb-caption"> <h5 class="thumb-title">' . $st_name . '</h5> <p class="thumb-meta text-small">' . $st_position . '</p> </div> </div>'; return $txt; }
function blog_thumbnail_style($atts, $current) { global $post, $mk_options; extract($atts); $image_height = $grid_image_height; if ($thumbnail_align == 'left') { $align_class = ' content-align-right'; } else { $align_class = ' content-align-left'; } if ($layout == 'full') { $image_width = $grid_width - 40; } else { $image_width = $content_width / 100 * $grid_width - 40; } $output = $has_image = ''; $post_type = get_post_meta($post->ID, '_single_post_type', true); /* * Image Width : 600px * Image Height : 460px */ $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_output_src = bfi_thumb($image_src_array[0], array('width' => '600', 'height' => '460')); if ($post_type == '') { $post_type = 'image'; } $output .= '<article id="' . get_the_ID() . '" class="mk-blog-thumbnail-item thumbnail-' . $item_id . ' mk-isotop-item ' . $post_type . '-post-type' . $align_class . '">' . "\n"; if (has_post_thumbnail()) { $output .= '<div class="featured-image" ><a href="' . get_permalink() . '" title="' . get_the_title() . '">'; $output .= ' <img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . $image_output_src . '" itemprop="image" />'; $output .= ' <div class="image-hover-overlay"></div>'; $output .= ' <div class="post-type-badge" href="' . get_permalink() . '"><i class="mk-li-' . $post_type . '"></i></div>'; $output .= '</a></div>'; } $output .= '<div class="mk-thumbnail-content-container">'; $output .= ' <div class="mk-blog-meta">'; $output .= ' <div class="mk-blog-author">'; ob_start(); the_author_posts_link(); $output .= ob_get_contents() . '</div>'; ob_get_clean(); $output .= ' <span class="mk-categories"> / ' . __('', 'mk_framework') . ' ' . get_the_category_list(', ') . ' </span> / <time datetime="' . get_the_date() . '"> <a href="' . get_month_link(get_the_time("Y"), get_the_time("m")) . '">' . get_the_date() . '</a> </time>'; $output .= ' <h3 class="the-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h3>'; if ($excerpt_length != 0) { ob_start(); the_excerpt_max_charlength($excerpt_length); $output .= '<div class="the-excerpt"><p>' . ob_get_clean() . '</p></div>'; } $output .= ' <div class="mk-teader-button">' . do_shortcode('[mk_button dimension="outline" corner_style="pointed" outline_skin="custom" outline_active_color="#000000" outline_hover_color="#fff" margin_bottom="0" size="medium" align="left" url="' . get_permalink() . '"]' . __('READ MORE', 'mk_framework') . '[/mk_button]') . ' </div>'; $output .= ' </div>'; $output .= ' </div>'; $output .= '<div class="clearboth"></div>'; $output .= '</article>' . "\n\n\n"; return $output; }
function resize_thumbnail_wpden($width = '', $height = '', $path = '') { // Include the library include_once 'BFI_Thumb.php'; // Our parameters, do a resize $params = array('width' => $width, 'height' => $height); // Get the URL of our processed image $image = bfi_thumb($path, $params); // Print out our img tag return $image; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? 'Mini Slideshow' : $instance['title'], $instance, $this->id_base); $count = (int) $instance["count"]; $width = (int) $instance["width"]; $height = (int) $instance["height"]; $random = rand(0, 999999); $output = '<div class="mk-widget-mini-slideshow mk-flexslider" id="testimonial_slider_' . $random . '"><ul class="mk-flex-slides">'; if ($count > 0) { for ($i = 1; $i <= $count; $i++) { $src = isset($instance["src_" . $i]) ? $instance["src_" . $i] : ''; require_once THEME_FUNCTIONS . "/bfi_cropping.php"; $image_src = bfi_thumb($src, array('width' => $width, 'height' => $height)); $output .= '<li>'; $output .= '<img alt="" src="' . $image_src . '" />'; $output .= '</li>'; } } $output .= "</ul></div>"; if (!empty($output)) { echo $before_widget; ?> <script type="text/javascript"> jQuery(document).ready(function() { jQuery('#testimonial_slider_<?php echo $random; ?> ').flexslider({ selector: ".mk-flex-slides > li", animation: "fade", //String: Select your animation type, "fade" or "slide" smoothHeight: false, //{NEW} Boolean: Allow height of the slider to animate smoothly in horizontal mode slideshowSpeed: 7000, //Integer: Set the speed of the slideshow cycling, in milliseconds animationSpeed: 400, //Integer: Set the speed of animations, in milliseconds pauseOnHover: true, //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering controlNav: false, //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage prevText: "", //String: Set the text for the "previous" directionNav item nextText: "" //String: Set the text for the "next" directionNav item }); }); </script> <?php if ($title) { echo $before_title . $title . $after_title; } echo $output; echo $after_widget; } }
function mk_thumbnail_image_gen($image, $width, $height) { $default = includes_url() . 'images/media/default.png'; if ($image == $default || empty($image)) { $default_url = THEME_IMAGES . '/dummy-images/dummy-' . mt_rand(1, 7) . '.png'; if (!empty($width) && !empty($height)) { $image = bfi_thumb($default_url, array('width' => $width, 'height' => $height, 'crop' => true)); return $image; } return $default_url; } else { return $image; } }
function widget($args, $instance) { extract($args); $title = apply_filters('CWS_Widget_Latest_Posts', $instance['title']); $head = ''; if ($title && $title != '') { $head = '<h3 class="widget-title">' . $title . '</h3>'; } global $post; $category = !empty($instance['category']) ? absint($instance['category']) : 0; $post_query = array('numberposts' => 3, 'cat' => $category); if ($instance['num_to_show']) { $post_query['numberposts'] = $instance['num_to_show']; } if ($instance['show_date']) { $post_query['show_date'] = $instance['show_date']; } $show_date = $instance['show_date'] ? $instance['show_date'] : false; $myposts = get_posts($post_query); echo $before_widget; echo '<div class="latest-posts-widget">' . $head . '<div class="widget-content"><ul>'; //$myposts = get_posts( $post_query ); foreach ($myposts as $post) { $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_id()), 'full', true); setup_postdata($post); echo '<li>'; if (has_post_thumbnail()) { echo '<div class="kids_image_wrapper ">'; echo '<a href="' . $thumbnail[0] . '" class="prettyPhoto kids_mini_picture" data-rel="prettyPhoto[rpwt]">'; echo '<img src="' . bfi_thumb($thumbnail[0], array('width' => 70, 'height' => 70, 'crop' => true)) . '" width="70" height="70" alt=""></a></div>'; } echo '<div class="kids_post_content"><h4><a href="' . get_permalink() . '">' . get_the_title() . '</a></h4>'; if ($show_date) { echo '<p>' . the_excerpt_max_charlength(25) . '</p>'; echo '<p class="time-post">' . get_the_date() . '</p>'; } else { echo '<p>' . the_excerpt_max_charlength(40) . '</p>'; } echo '</div></li>'; } wp_reset_postdata(); echo '</ul></div></div>' . $args['after_widget']; }
/** * * * @package Kopa * @subpackage Core * @author thethangtran <*****@*****.**> * @since 1.0.0 * */ public static function get_image_src($image, $size = NULL, $width = NULL, $height = NULL, $crop = true) { $src = NULL; if ($size) { $size = self::detect_image_size($size); } if (!empty($image)) { if (empty($width) && empty($height) && !empty($size)) { $sizes = KopaInit::get_image_sizes(); if (isset($sizes[$size])) { $width = $sizes[$size]['width']; $height = $sizes[$size]['height']; $crop = $sizes[$size]['crop']; } } $src = bfi_thumb($image, array('width' => $width, 'height' => $height, 'crop' => $crop)); } return apply_filters('kopa_image_get_image_src', $src); }
/** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget($args, $instance) { extract($args); extract($instance); $hasWrapper = false; $i = 1; $n_items = $this->n_items; if ($id == 'home-sidebar-3') { $hasWrapper = true; } ?> <div class='<?php echo $hasWrapper ? 'col-sm-6' : 'col-xs-12'; ?> '> <div class="widget box-accordion"> <h2 class="box-title"><img src="<?php bloginfo('template_url'); ?> /assets/img/icon-list-small.png">PROIECTE FINALIZATE</h2> <?php $bfi_args = array('width' => 166, 'height' => 69); while ($i <= $n_items) { $img = $instance["url_img_{$i}"]; $img = bfi_thumb($img, $bfi_args); $text = $instance["text_{$i}"] . " <a href='{$instance["url_{$i}"]}'>{$instance["url_text_{$i}"]}</a> <span class='arrow-small'>›</span>"; $first = $i == 1; $this->get_item($i, $img, $text, $first); $i++; } ?> </div> <!-- .box-accordion --> </div> <?php }
function ktz_gallery_slide() { global $post; $meta_values = get_post_custom($post->ID); if (isset($meta_values['ktz_gallery_post_postformat'][0]) && has_post_format('gallery')) { $title = get_the_title(); $gallery = explode(',', get_post_meta(get_the_ID(), 'ktz_gallery_post_postformat', true)); echo '<div class="box_gallery box_gallery_single"><div id="inner_box_gallery">'; $count = 0; foreach ($gallery as $slide) { $attachment_url = get_attachment_link($slide); $img_url = wp_get_attachment_url($slide); $desc_img = get_the_title($slide); $params = array('width' => 539); $image_ori = bfi_thumb($img_url, $params); //resize & crop the image if ($count == 0) { echo '<a class="data-original-link" href="' . $attachment_url . '" data-title="Image for ' . $desc_img . '"><img class="data-original" src="' . $image_ori . '" height="auto" width="539" alt="' . $desc_img . '" title="' . $desc_img . '" /></a>'; } $count++; } echo '</div>'; echo '<div class="widget_carousel ktz-slidesingle"><div class="list_carousel"><div class="ktzcarousel-little owl-carousel owl-theme owl-little">'; foreach ($gallery as $slide) { $attachment_url = get_attachment_link($slide); $img_url = wp_get_attachment_url($slide); $desc_img = get_the_title($slide); $params_1 = array('width' => 177, 'height' => 130, 'crop' => true); $image = bfi_thumb($img_url, $params_1); //resize & crop the image $params_2 = array('width' => 539); $image_ori = bfi_thumb($img_url, $params_2); //resize & crop the image echo '<div class="item ktz-widgetcolor"><img src="' . $image . '" data-ori="' . $attachment_url . '" data-crop="' . $image_ori . '" height="130" width="177" alt="' . $desc_img . '" data-title="' . $desc_img . '" /></div>'; } echo '</div></div></div></div>'; } else { echo '<div class="ktz-featuredimg">'; echo ktz_featured_img_width(540); echo '</div>'; } }
function ktz_get_gallery_post() { global $post; $meta_values = get_post_custom($post->ID); if (isset($meta_values['ktz_gallery_post_postformat'][0]) && has_post_format('gallery')) { $title = get_the_title(); $gallery = explode(',', get_post_meta(get_the_ID(), 'ktz_gallery_post_postformat', true)); echo '<div class="ktz-gallery"><ul>'; foreach ($gallery as $slide) { $attachment_url = get_attachment_link($slide); $img_url = wp_get_attachment_url($slide); $desc_img = get_the_title($slide); $params = array('width' => 140, 'height' => 120, 'crop' => true); $image_ori = bfi_thumb($img_url, $params); //resize & crop the image echo '<li>'; echo '<a href="' . $attachment_url . '" title="Image for ' . $desc_img . '"><img src="' . $image_ori . '" height="250" width="300" alt="' . $desc_img . '" title="' . $desc_img . '" /></a>'; echo '</li>'; } echo '<ul></div>'; } }
function my_post_gallery($output, $attr) { global $post; if (isset($attr['orderby'])) { $attr['orderby'] = sanitize_sql_orderby($attr['orderby']); if (!$attr['orderby']) { unset($attr['orderby']); } } extract(shortcode_atts(array('order' => 'ASC', 'orderby' => 'menu_order ID', 'id' => $post->ID, 'itemtag' => 'dl', 'icontag' => 'dt', 'captiontag' => 'dd', 'columns' => 3, 'size' => 'full', 'include' => '', 'exclude' => ''), $attr)); $id = intval($id); if ('RAND' == $order) { $orderby = 'none'; } if (!empty($include)) { $include = preg_replace('/[^0-9,]+/', '', $include); $_attachments = get_posts(array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby)); $attachments = array(); foreach ($_attachments as $key => $val) { $attachments[$val->ID] = $_attachments[$key]; } } if (empty($attachments)) { return ''; } // Here's your actual output, you may customize it to your need $output = "<div class=\"gallery-wrapper row\">\n"; // Now you loop through each attachment foreach ($attachments as $id => $attachment) { $img = wp_get_attachment_image_src($id, 'full'); $bfi_args = array('width' => 180, 'height' => 180); $bfi_img = bfi_thumb($img[0], $bfi_args); $output .= "<div class='gallery-item col-lg-3 col-sm-4 col-xs-2'>"; $output .= "<a href='{$img['0']}'><img src=\"{$bfi_img}\" /></a>"; $output .= "</div>"; } $output .= "</div>\n"; return $output; }
function tva_ajaxdata() { if (isset($_POST)) { $data_contents = $data_source = $type = ''; } $type = isset($_POST['type']) ? $_POST['type'] : ''; $data_source = isset($_POST['source']) ? $_POST['source'] : ''; $query = isset($_POST['query']) ? $_POST['query'] : ''; $data_offset = isset($_POST['data_offset']) ? $_POST['data_offset'] : ''; $load_value = isset($_POST['load_value']) ? $_POST['load_value'] : ''; $postlayout = isset($_POST['postlayout']) ? $_POST['postlayout'] : ''; $grid_columns = isset($_POST['grid_columns']) ? $_POST['grid_columns'] : ''; $config = isset($_POST['attributes']) ? $_POST['attributes'] : ''; $attributes = !empty($config) ? explode('|', $config) : array(); foreach ($attributes as $attribute) { list($key, $value) = explode(":", $attribute); $config_attributes[$key] = $value; } // Configuration Options $NV_gridcolumns = $grid_columns; $NV_slidercolumns = $load_value; $NV_groupgridcontent = !empty($config_attributes['content']) ? $config_attributes['content'] : ''; $NV_imgwidth = !empty($config_attributes['img_width']) ? $config_attributes['img_width'] : ''; $NV_imgheight = !empty($config_attributes['img_height']) ? $config_attributes['img_height'] : ''; $NV_lightbox = !empty($config_attributes['lightbox']) ? $config_attributes['lightbox'] : ''; $NV_imageeffect = !empty($config_attributes['imageeffect']) ? $config_attributes['imageeffect'] : ''; $NV_customlayer = !empty($config_attributes['customlayer']) ? $config_attributes['customlayer'] : ''; $NV_zoomhover = !empty($config_attributes['zoomhover']) ? $config_attributes['zoomhover'] : ''; $NV_gridcolumns_text = !empty($NV_gridcolumns) ? $NV_slidercolumns_text = numberToWords($NV_gridcolumns) : ''; $columnpadding = !empty($config_attributes['columnpadding']) ? $config_attributes['columnpadding'] : ''; $NV_shortcode_id = !empty($config_attributes['shortcodeid']) ? $config_attributes['shortcodeid'] : ''; $NV_blackwhite = ''; if ($NV_imageeffect == 'shadowblackwhite' || $NV_imageeffect == 'frameblackwhite' || $NV_imageeffect == 'blackwhite') { $NV_blackwhite = 'blackwhite'; if ($NV_imageeffect == 'shadowblackwhite') { $NV_imageeffect = 'shadow'; } if ($NV_imageeffect == 'frameblackwhite') { $NV_imageeffect = 'frame'; } if ($NV_imageeffect == 'blackwhite') { $NV_imageeffect = 'none'; } } if ($data_source == 'data-4') { if (!is_array($query)) { $slide_sets = rtrim($query, ','); $slide_sets = explode(",", $query); } else { $slide_sets = implode(",", $query); // needed to upgrades of older versions $slide_sets = explode(",", $query); } $sorted_slidesets = array(); foreach ($slide_sets as $slide_set) { if (is_numeric($slide_set)) { $slide_id = $slide_set; $slide_name = get_the_title($slide_set); $sorted_slidesets[$slide_name] = $slide_id; } else { $name = get_page_by_title($slide_set, 'OBJECT', "slide-sets"); $slide_id = $name->ID; $slide_name = $slide_set; $sorted_slidesets[$slide_name] = $slide_id; } } ksort($sorted_slidesets); $slide_sets = $sorted_slidesets; $slide_set_array = array(); $postcount = 0; $slidecount = 0; $data_id = $data_offset; foreach ($slide_sets as $slide_set) { $slide_xml = get_post_meta($slide_set, 'slide_manager_xml', true); $slide_data = new DOMDocument(); $slide_data->loadXML($slide_xml); $slide_set = $slide_data->documentElement; foreach ($slide_set->childNodes as $slide) { // Get Attached / Post Image Data $get_image_src = wp_get_attachment_image_src(find_xml_value($slide, 'image'), 'full'); // Get Image Meta Data Attachment ID $attachment_meta = themeva_attachment_data(find_xml_value($slide, 'image')); $slide_set_array[$slidecount]['img'] = $get_image_src; $slide_set_array[$slidecount]['img_url'] = $get_image_src[0]; $slide_set_array[$slidecount]['media_url'] = find_xml_value($slide, 'media_url'); $slide_set_array[$slidecount]['embed_type'] = find_xml_value($slide, 'embed_type'); $slide_set_array[$slidecount]['autoplay'] = find_xml_value($slide, 'autoplay'); $slide_set_array[$slidecount]['title'] = find_xml_value($slide, 'title') != '' ? find_xml_value($slide, 'title') : $attachment_meta['title']; $slide_set_array[$slidecount]['description'] = find_xml_value($slide, 'description') != '' ? find_xml_value($slide, 'description') : $attachment_meta['description']; $slide_set_array[$slidecount]['link_url'] = find_xml_value($slide, 'link_url'); $slide_set_array[$slidecount]['css_classes'] = find_xml_value($slide, 'css_classes'); $slide_set_array[$slidecount]['readmore_link'] = find_xml_value($slide, 'readmore_link'); $slide_set_array[$slidecount]['timeout'] = find_xml_value($slide, 'timeout'); $slide_set_array[$slidecount]['filter_tags'] = find_xml_value($slide, 'filter_tags'); $slidecount++; } } $slide_set_array = array_slice($slide_set_array, $data_offset, $load_value); foreach ($slide_set_array as $slide_set) { $NV_disablegallink = $NV_movieurl = $NV_previewimgurl = $NV_cssclasses = $NV_galexturl = $NV_videotype = $NV_videoautoplay = $NV_posttitle = $NV_description = $NV_slidetimeout = $img = ''; $img = $slide_set['img']; $NV_previewimgurl = $slide_set['img_url']; $NV_movieurl = $slide_set['media_url']; $NV_videotype = $slide_set['embed_type']; $NV_videoautoplay = $slide_set['autoplay']; $NV_posttitle = $slide_set['title']; $NV_description = $slide_set['description']; $NV_galexturl = $slide_set['link_url']; $NV_cssclasses = $slide_set['css_classes']; $NV_disablereadmore = $slide_set['readmore_link']; $NV_slidetimeout = $slide_set['timeout']; $tags_array = $slide_set['filter_tags']; $NV_disablegallink = empty($NV_galexturl) ? 'yes' : ''; $NV_disablereadmore = $NV_disablereadmore == 'off' ? 'yes' : ''; $NV_videoautoplay = $NV_videoautoplay == 'on' ? '1' : '0'; $categories = ''; // Enter Categories into an Array if (!empty($tags_array)) { $tags_array = str_replace(" ", "", $tags_array); $tags_array = explode(',', $tags_array); foreach ($tags_array as $tag) { $categories .= $tag . $NV_shortcode_id . ','; } $replace_arr = array(' ', ','); $replace_with = array('_', ' '); $categories = str_replace($replace_arr, $replace_with, $categories); } // Assign unique video ID $video_id = $postcount + $data_id; $postcount++; $data_id++; $output = ''; $NV_show_slider = $type; // Check is Timthumb is Enabled or Disabled if (of_get_option('timthumb_disable') != 'disable' && empty($NV_customlayer)) { require_once NV_FILES . '/adm/functions/BFI_Thumb.php'; if (!empty($NV_imgwidth)) { $params['width'] = $NV_imgwidth; } if (!empty($NV_imgheight)) { $params['height'] = $NV_imgheight; } if ($NV_imgzoomcrop == '0') { $params['crop'] = true; } if ($NV_imageeffect == 'circular') { $params['height'] = $params['width']; } $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); } else { $NV_imagepath = dyn_getimagepath($NV_previewimgurl); } require get_slider_frame($type); $data_contents .= $output; } } die($data_contents); }
function wpsm_thumb($size = 'small') { global $post; if ($size == 'medium_news') { $width = 370; $height = 220; $nothumb = get_template_directory_uri() . '/images/default/noimage_370_220.png'; } elseif ($size == 'med_thumbs') { $width = 123; $height = 90; $nothumb = get_template_directory_uri() . '/images/default/noimage_123_90.png'; } elseif ($size == 'feature_slider') { $width = 765; $height = 460; $nothumb = get_template_directory_uri() . '/images/default/noimage_765_460.jpg'; } elseif ($size == 'video_big') { $width = 474; $height = 342; $nothumb = get_template_directory_uri() . '/images/default/noimage_474_342.png'; } elseif ($size == 'video_narrow') { $width = 270; $height = 110; $nothumb = get_template_directory_uri() . '/images/default/noimage_270_110.png'; } elseif ($size == 'news_big') { $width = 378; $height = 310; $nothumb = get_template_directory_uri() . '/images/default/noimage_378_310.png'; } elseif ($size == 'grid_news') { $width = 336; $height = 220; $nothumb = get_template_directory_uri() . '/images/default/noimage_336_220.png'; } else { $width = 123; $height = 90; $nothumb = get_template_directory_uri() . '/images/default/noimage_123_90.png'; } if (rehub_option('aq_resize') == 1) { if (rehub_option('aq_resize_crop') == '1') { $params = array('width' => $width, 'quality' => '90'); } else { $params = array('width' => $width, 'height' => $height, 'crop' => true, 'quality' => '90'); } $img = get_post_thumb(); if (!empty($img)) { ?> <img src="<?php echo bfi_thumb($img, $params); ?> " alt="<?php the_title_attribute(); ?> " /> <?php } elseif (vp_metabox('rehub_post.rehub_framework_post_type') == 'video' && vp_metabox('rehub_post.video_post.0.video_post_embed_url') != '') { ?> <?php $img_video_url = vp_metabox('rehub_post.video_post.0.video_post_embed_url'); $img_video = parse_video_url($img_video_url, 'hqthumb'); ?> <img src="<?php echo $img_video; ?> " alt="<?php the_title_attribute(); ?> " /> <?php } else { ?> <img src="<?php echo $nothumb; ?> " alt="<?php the_title_attribute(); ?> " /> <?php } } else { $image_id = get_post_thumbnail_id($post->ID); $image_url = wp_get_attachment_image($image_id, $size, false, array('alt' => get_the_title(), 'title' => get_the_title())); if (!empty($image_url)) { ?> <?php echo $image_url; ?> <?php } elseif (vp_metabox('rehub_post.rehub_framework_post_type') == 'video' && vp_metabox('rehub_post.video_post.0.video_post_embed_url') != '') { ?> <?php $img_video_url = vp_metabox('rehub_post.video_post.0.video_post_embed_url'); $img_video = parse_video_url($img_video_url, 'hqthumb'); ?> <img src="<?php echo $img_video; ?> " alt="<?php the_title_attribute(); ?> "/> <?php } else { ?> <img src="<?php echo $nothumb; ?> " alt="<?php the_title_attribute(); ?> " /> <?php } } }
function block($instance) { extract($instance); $title1 = !empty($title) ? ' ' . esc_attr($title) : ''; $show1 = !empty($show) ? ' ' . esc_attr($show) : ''; $text1 = !empty($text) ? ' ' . esc_attr($text) : ''; ?> <!--Portfolio section--> <section id="<?php echo $id; ?> " class="offset section bBottom"> <!--Inner content--> <div class="innerContent "> <!--Container--> <div class="container clearfix"> <div class="sixteen columns"> <h1 class="titleBig"><?php echo $title1; ?> </h1> </div> <!-- Filter nav --> <div class="filterNav"> <ul id="category" class="filter"> <li class="all current"><a href="#"><?php echo $text1; ?> </a></li> <?php $categories = get_terms('categories'); foreach ((array) $categories as $categorie) { $cat_name = $categorie->name; $cat_slug = $categorie->slug; ?> <li class="<?php echo $cat_slug; ?> "><a href="#"> <?php echo $cat_name; ?> </a></li> <?php } ?> </ul> </div> <!-- End filter nav --> <!-- Works list --> <div id="works" class="clearfix "> <!--Portfolio--> <ul class="portfolio clearfix"> <?php $args = array('post_type' => 'portfolio', 'posts_per_page' => $show1, 'order' => $orderpost, 'orderby' => $orderby); $wp_query = new WP_Query($args); $i = 1; while ($wp_query->have_posts()) { $wp_query->the_post(); $cates = get_the_terms(get_the_ID(), 'categories'); $cate_name = ''; $cate_slug = ''; foreach ((array) $cates as $cate) { if (count($cates) > 0) { $cate_name .= $cate->name . ' '; $cate_slug .= $cate->slug . ' '; } } $params = array('width' => 320, 'height' => 343); $image = bfi_thumb(wp_get_attachment_url(get_post_thumbnail_id()), $params); ?> <li class="one-third column item " data-id="id-<?php echo $i; ?> " data-type="<?php echo $cate_slug; ?> "><div > <a href="<?php echo wp_get_attachment_url(get_post_thumbnail_id()); ?> " class="folio"> <div class="desc"> <h3 class="projDesc"><?php the_title(); ?> <span>― <?php echo $cate_name; ?> ―</span></h3> </div> <img src="<?php echo $image; ?> " alt=""> </a> </div></li> <?php $i++; } ?> </ul> <!--End portfolio--> </div> <!-- End works list --> </div> <!--End container--> </div> <!--End inner content--> </section> <!--End portfolio section--> <?php }
function mk_portfolio_classic_loop(&$r, $atts) { global $post; extract($atts); global $mk_options; if ($column > 6) { $column = 6; } switch ($column) { case 1: if ($layout == 'full') { $width = $mk_options['grid_width'] - 62; } else { $width = round($mk_options['content_width'] / 100 * $mk_options['grid_width']) - 62; } $column_css = 'portfolio-one-column'; break; case 2: if ($layout == 'full') { $width = round($mk_options['grid_width'] / 2) - 42; } else { $width = round($mk_options['content_width'] / 100 * $mk_options['grid_width'] / 2) - 47; } $column_css = 'portfolio-two-column'; break; case 3: if ($layout == 'full') { $width = round($mk_options['grid_width'] / 3) - 36; } else { $width = round($mk_options['content_width'] / 100 * $mk_options['grid_width'] / 2) - 47; } $column_css = 'portfolio-three-column'; break; case 4: if ($layout == 'full') { $width = round($mk_options['grid_width'] / 4) - 32; } else { $width = round($mk_options['content_width'] / 100 * $mk_options['grid_width'] / 2) - 47; } $column_css = 'portfolio-four-column'; break; case 5: if ($layout == 'full') { $width = round($mk_options['grid_width'] / 5) - 30; } else { $width = round($mk_options['content_width'] / 100 * $mk_options['grid_width'] / 2) - 47; } $column_css = 'portfolio-five-column'; break; case 6: if ($layout == 'full') { $width = round($mk_options['grid_width'] / 6) - 32; } else { $width = round($mk_options['content_width'] / 100 * $mk_options['grid_width'] / 2) - 47; } $column_css = 'portfolio-six-column'; break; } if ($layout == 'full') { $layout_class = 'portfolio-full-layout'; } else { $layout_class = 'portfolio-with-sidebar'; } $output = ''; $terms = get_the_terms(get_the_id(), 'portfolio_category'); $terms_slug = array(); $terms_name = array(); if (is_array($terms)) { foreach ($terms as $term) { $terms_slug[] = $term->slug; $terms_name[] = '<a href="' . get_term_link($term->slug, 'portfolio_category') . '">' . $term->name . '</a>'; } } $height = !empty($height) ? $height : 600; $post_type = get_post_meta($post->ID, '_single_post_type', true); $post_type = !empty($post_type) ? $post_type : 'image'; $link_to = get_post_meta(get_the_ID(), '_portfolio_permalink', true); $permalink = ''; if (!empty($link_to)) { $link_array = explode('||', $link_to); switch ($link_array[0]) { case 'page': $permalink = get_page_link($link_array[1]); break; case 'cat': $permalink = get_category_link($link_array[1]); break; case 'portfolio': $permalink = get_permalink($link_array[1]); break; case 'post': $permalink = get_permalink($link_array[1]); break; case 'manually': $permalink = $link_array[1]; break; } } if (empty($permalink)) { $permalink = get_permalink(); } $output .= '<article id="' . get_the_ID() . '" class="mk-portfolio-item mk-portfolio-classic-item classic-' . $item_id . ' mk-isotop-item ' . $column_css . ' ' . $layout_class . ' portfolio-' . $post_type . ' ' . implode(' ', $terms_slug) . '"><div class="portfolio-classic-holder">'; switch ($image_size) { case 'full': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_output_src = $image_src_array[0]; break; case 'crop': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_output_src = bfi_thumb($image_src_array[0], array('width' => $width * $image_quality, 'height' => $height * $image_quality)); break; case 'large': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large', true); $image_output_src = $image_src_array[0]; break; case 'medium': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium', true); $image_output_src = $image_src_array[0]; break; default: $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_output_src = bfi_thumb($image_src_array[0], array('width' => $width * $image_quality, 'height' => $height * $image_quality)); break; } $lightbox_full_size = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $lightbox = $single_hover_icon = ''; if ($disable_permalink == 'false') { $single_hover_icon = ' hover-single-icon'; } if ($post_type == 'image' || $post_type == '') { if ($disable_zoom_link == 'true') { $lightbox = '<a rel="portfolio-classic" title="' . get_the_title() . '" data-fancybox-group="portfolio-classic-item" class="zoom-badge portfolio-classic-lightbox mk-lightbox' . $single_hover_icon . '" href="' . $lightbox_full_size[0] . '"><i class="mk-jupiter-icon-plus-circle"></i></a>'; } } else { if ($post_type == 'video') { $video_id = get_post_meta($post->ID, '_single_video_id', true); $video_site = get_post_meta($post->ID, '_single_video_site', true); $video_url = ''; if ($video_site == 'vimeo') { $video_url = 'http' . (is_ssl() ? 's' : '') . '://player.vimeo.com/video/' . $video_id . '?autoplay=0'; } elseif ($video_site == 'youtube') { $video_url = 'http' . (is_ssl() ? 's' : '') . '://www.youtube.com/embed/' . $video_id . '?autoplay=0'; } elseif ($video_site == 'dailymotion') { $video_url = 'http' . (is_ssl() ? 's' : '') . '://www.dailymotion.com/embed/video/' . $video_id . '?logo=0'; } if ($disable_zoom_link == 'true') { $lightbox = '<a data-title="' . get_the_title() . '" data-fancybox-group="portfolio-classic-item" class="video-badge mk-lightbox' . $single_hover_icon . '" href="' . $video_url . '"><i class="mk-jupiter-icon-plus-circle"></i></a>'; } } } $output .= '<div class="featured-image">'; $output .= '<img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . mk_thumbnail_image_gen($image_output_src, $width, $height) . '" />'; $output .= '<div class="image-hover-overlay"></div>'; if ($disable_permalink == 'true') { $output .= '<a class="permalink-badge" target="' . $target . '" href="' . $permalink . '"><i class="mk-jupiter-icon-arrow-circle"></i></a>'; } $output .= $lightbox; $output .= '</div>'; $output .= '<div class="portfolio-meta-wrapper">'; if ($disable_permalink == 'true') { $output .= '<h3 class="the-title"><a target="' . $target . '" href="' . $permalink . '">' . get_the_title() . '</a></h3><div class="clearboth"></div>'; } else { $output .= '<h3 class="the-title">' . get_the_title() . '</h3><div class="clearboth"></div>'; } $output .= '<div class="portfolio-categories">' . implode(', ', $terms_name) . ' </div>'; if ($disable_excerpt == 'true') { $output .= '<p class="the-excerpt">' . get_the_excerpt() . '</p>'; } $output .= '</div>'; $output .= '<div class="clearboth"></div></div></article>' . "\n\n\n"; return $output; }
$link = add_query_arg(array('s' => '', 'post_type' => $st_type, $location_text => get_the_ID()), home_url('/')); } if ($link_to == 'single') { $link = get_the_permalink(); } ?> <a class="hover-img" href="<?php echo esc_url($link); ?> "> <?php $img = get_the_post_thumbnail(get_the_ID(), array(800, 600, 'bfi_thumb' => true)); if (!empty($img)) { echo balanceTags($img); } else { echo '<img width="800" height="600" alt="no-image" class="wp-post-image" src="' . bfi_thumb(get_template_directory_uri() . '/img/no-image.png', array('width' => 800, 'height' => 600)) . '">'; } ?> <div class="hover-inner hover-inner-block hover-inner-bottom hover-inner-bg-black hover-hold"> <?php $img = get_post_meta(get_the_ID(), 'logo', true); if ($st_show_logo == 'yes' && !empty($img)) { ?> <div class="img-<?php echo esc_attr($st_logo_position); ?> "> <img title="logo" alt="logo" src="<?php echo balanceTags($img); ?> ">
$i = 0; $image_height = $image_height / 2 - 4; $r = new WP_Query($side_query); if ($r->have_posts()) { while ($r->have_posts()) { $r->the_post(); if ($i == 0) { $image_width = $grid_width * 0.4 - 8; $item_class = 'full-item'; } else { $image_width = $grid_width * 0.2 - 8; $item_class = 'half-item'; } $output .= '<article id="entry-' . get_the_ID() . '" class="blog-teaser-side-item ' . $item_class . '"><div class="item-holder">'; $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_src = bfi_thumb($image_src_array[0], array('width' => $image_width, 'height' => $image_height, 'crop' => true)); if (has_post_thumbnail()) { $output .= '<div class="thumb-featured-image"><a title="' . get_the_title() . '" href="' . get_permalink() . '">'; $output .= '<img alt="' . get_the_title() . '" width="' . $image_width . '" class="item-featured-image" height="' . $image_height . '" title="' . get_the_title() . '" src="' . mk_thumbnail_image_gen($image_src, $image_width, $image_height) . '" itemprop="image" />'; $output .= '<div class="image-hover-overlay"></div>'; $output .= '</a></div>'; } $output .= '<div class="blog-meta">'; $output .= '<h2 class="blog-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h2>'; $output .= '<div class="blog-categories">' . get_the_category_list(', ') . '</div>'; $output .= '<div class="clearboth"></div></div>'; $output .= '</div></article>'; $i++; } } $output .= '</div>';
if (function_exists('has_post_thumbnail') && has_post_thumbnail()) { ?> <a href="<?php the_permalink(); ?> "> <?php if (rehub_option('aq_resize') == 1) { ?> <?php $img = get_post_thumb(); ?> <img src="<?php $params = array('width' => 336, 'height' => 220); echo bfi_thumb($img, $params); ?> " alt="<?php the_title_attribute(); ?> " /> <?php } else { ?> <?php the_post_thumbnail('grid_news'); ?> <?php } ?>
$(".rehub_woo_review .pretty_woo a[rel^='prettyPhoto']").prettyPhoto({social_tools:false}); }); </script> <div class="rehub_woo_review_tabs pretty_woo"> <?php wp_enqueue_script('prettyphoto'); foreach ($gallery_images as $gallery_img) { ?> <a href="<?php echo esc_attr($gallery_img); ?> "> <img src="<?php $params = array('width' => 100, 'height' => 100); echo bfi_thumb($gallery_img, $params); ?> " alt="<?php echo esc_attr($offer_title); ?> " /> </a> <?php } ?> </div> <?php } ?> <?php if (!empty($import_comments)) {
<p><span class="price_count"><?php echo $product->get_price_html(); ?> </span></p> <?php } ?> <?php if (!empty($term_brand_image['brand_image'])) { ?> <div class="aff_tag"> <img src="<?php $params = array('width' => 120, 'height' => 90); echo bfi_thumb($term_brand_image['brand_image'], $params); ?> " alt="<?php the_title_attribute(); ?> " /> </div> <?php } ?> </div> <div class="buttons_col"> <div class="priced_block"> <?php if ($product->is_in_stock() && $product->add_to_cart_url() != '') { ?>
} if ($animation != '') { $animation_css = 'mk-animate-element ' . $animation . ' '; } $image_id = mk_get_attachment_id_from_url($src); $alt = get_post_meta($image_id, '_wp_attachment_image_alt', true); $image_alt = !empty($alt) ? $alt : $title; $image_title = !empty($title) ? $title : $alt; $output .= '<div class="mk-image-shortcode mk-shortcode ' . $visibility . ' ' . $lightbox_enabled . ' align-' . $align . ' ' . $animation_css . $frame_style . '-frame ' . $caption_location . ' ' . $el_class . '" style="max-width: ' . $image_width . 'px; margin-bottom:' . $margin_bottom . 'px">'; if (!empty($heading_title)) { $output .= '<h3 class="mk-shortcode mk-fancy-title pattern-style mk-shortcode-heading"><span>' . $heading_title . '</span></h3>'; } $svg = $svg == 'true' ? 'style="max-width:' . $image_width . 'px" ' : ''; $output .= '<div class="mk-image-inner">'; if ($crop == 'true') { $image_src = bfi_thumb($src, array('width' => $image_width, 'height' => $image_height)); $output .= '<img class="lightbox-' . $lightbox . '" alt="' . $image_alt . '" title="' . $image_title . '" src="' . $image_src . '" ' . $svg . '/>'; } else { $output .= '<img class="lightbox-' . $lightbox . '" alt="' . $image_alt . '" title="' . $image_title . '" src="' . $src . '" ' . $svg . '/>'; } if ($lightbox == 'true') { $output .= '<div class="mk-image-overlay"></div>'; $output .= '<a href="' . $src_lightbox . '" alt="' . $image_alt . '" data-fancybox-group="image-shortcode-' . $group . '" title="' . $title . '" class="mk-lightbox ' . $group . ' mk-image-shortcode-lightbox"><i class="mk-jupiter-icon-plus-circle"></i></a>'; } if ($link) { $output .= '<a href="' . $link . '" target="' . $target . '" class="mk-image-shortcode-link"> </a>'; } $output .= '</div>'; if (!empty($title) || !empty($desc)) { $output .= '<div class="mk-image-caption">'; if (!empty($title)) {
echo $NV_movieurl; } else { echo $NV_previewimgurl; } echo '" title="' . $NV_posttitle . '" data-fancybox-group="gallery' . $NV_shortcode_id . '" style="width:' . $NV_imgwidth . 'px"'; if (!empty($NV_movieurl)) { echo 'class="fancybox galleryvid ' . $NV_blackwhite . '"'; } else { echo 'class="fancybox galleryimg ' . $NV_blackwhite . ' "'; } echo '>'; } elseif ($NV_disablegallink != 'yes') { echo '<a href="' . $NV_galexturl . '" title="' . $NV_posttitle . '" style="width:' . $NV_imgwidth . 'px" class="' . $NV_blackwhite . '">'; } $params['width'] = $NV_imgwidth; $NV_imagepath = bfi_thumb(dyn_getimagepath($NV_previewimgurl), $params); ?> <img src="<?php echo $NV_imagepath; ?> " alt="<?php echo $NV_posttitle; ?> " <?php echo $NV_imgwidth_attr; ?> class="accordion-img" /> <?php if ($NV_disablegallink != 'yes' || $NV_lightbox == "yes") {
function blog_func($atts, $content = null) { extract(shortcode_atts(array('btntext' => '', 'link' => ''), $atts)); ob_start(); ?> <div class="z-index"> <?php $args = array('post_type' => 'post', 'posts_per_page' => 3); $blog = new WP_Query($args); if ($blog->have_posts()) { while ($blog->have_posts()) { $blog->the_post(); ?> <div class="one-third column"> <div class="blog-post home-blog"> <?php $params = array('width' => 420, 'height' => 201); $image = bfi_thumb(wp_get_attachment_url(get_post_thumbnail_id()), $params); ?> <a href="<?php the_permalink(); ?> "><img src="<?php echo esc_url($image); ?> " alt="" /></a> <h5><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h5> <p><?php echo esc_attr(ananke_blog_excerpt('18')); ?> </p> <p><span><?php the_time('d.m.Y.'); ?> </span><span> <?php comments_number(__('0 comment', 'anake'), __('1 comment', 'ananke'), __('% comments', 'ananke')); ?> </span></p> </div> </div> <?php } } ?> <div class="clear"></div> <div class="sixteen columns"> <div class="blog-link"><a href="<?php echo esc_url($link); ?> "><?php echo esc_attr($btntext); ?> </a></div> </div> </div> <?php return ob_get_clean(); }
if ($enable_excerpt == 'true') { $except = get_the_excerpt(); if ($except) { $output .= '<p class="blog-carousel-excerpt">' . get_the_excerpt() . '</p>'; } } $output .= '</div>'; $output .= '</div></li>'; } } else { $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $output .= '<li><div><div class="blog-carousel-thumb"><a href="' . get_permalink() . '">'; if (has_post_thumbnail()) { $image_src = bfi_thumb($image_src_array[0], array('width' => 245, 'height' => 180)); } else { $image_src = bfi_thumb(THEME_IMAGES . '/empty-thumb.png', array('width' => 245, 'height' => 180)); } $output .= '<img src="' . mk_thumbnail_image_gen($image_src, 245, 180) . '" alt="' . get_the_title() . '" title="' . get_the_title() . '" />'; $output .= '<div class="blog-carousel-overlay"></div>'; $output .= '</a></div>'; $output .= '<h5 class="blog-carousel-title"><a href="' . get_permalink() . '">' . get_the_title() . '</a></h5>'; if ($enable_excerpt == 'true') { $output .= '<p class="blog-carousel-excerpt">' . get_the_excerpt() . '</p>'; } $output .= '</div></li>'; } } } wp_reset_query(); $output .= '</ul></div><div class="clearboth"></div></div>'; echo $output;
<img src="<?php echo bfi_thumb(esc_attr($aff_thumb), $params); ?> " alt="<?php echo esc_attr($offer_title); ?> " /> <?php } else { ?> <?php $image_id = get_post_thumbnail_id(get_the_ID()); $image_offer_url = wp_get_attachment_url($image_id); ?> <img src="<?php echo bfi_thumb($image_offer_url, $params); ?> " alt="<?php echo esc_attr($offer_title); ?> " /> <?php } ?> <span class="show_more_images"><?php _e('Show more images', 'rehub_framework'); ?> </span> <?php if (!empty($offer_price_old) && $offer_price_old != '0') {
<div class="clearfix"> <figure> <a rel="nofollow" target="_blank" href="<?php echo esc_url($afflink); ?> "<?php echo $item['ga_event']; ?> > <?php if (!empty($aff_thumb)) { ?> <img src="<?php $params = array('height' => 100); echo bfi_thumb(esc_attr($aff_thumb), $params); ?> " alt="<?php echo esc_attr($offer_title); ?> " /> <?php } else { ?> <img src="<?php echo get_template_directory_uri(); ?> /images/default/noimage_123_90.png" alt="<?php echo esc_attr($offer_title); ?> " />
<?php if (!empty($gallery_img['gallery_post_image_caption'])) { ?> <div class="bigcaption"><?php echo $gallery_img['gallery_post_image_caption']; ?> </div><?php } ?> <img src="<?php if ($resizer == '1') { $params = array('width' => 765); } else { $params = array('width' => 765, 'height' => 478, 'crop' => true); } echo bfi_thumb($gallery_img['gallery_post_image'], $params); ?> " /> </li> <?php } ?> <?php } ?> <?php } ?> </ul> </div>
function mk_news_loop($atts, $current) { global $post; extract($atts); global $mk_options; $grid_width = $mk_options['grid_width']; $content_width = $mk_options['content_width']; $post_style = get_post_meta($post->ID, '_news_post_style', true); $terms = get_the_terms(get_the_id(), 'news_category'); $terms_slug = array(); $terms_name = array(); if (is_array($terms)) { foreach ($terms as $term) { $terms_slug[] = $term->slug; $terms_name[] = $term->name; } } switch ($post_style) { case 'full-with-image': if ($layout == 'full') { $image_width = round($grid_width - 55); } else { $image_width = round($content_width / 100 * $grid_width - 66); } break; case 'full-without-image': if ($layout == 'full') { $image_width = round($grid_width - 66); } else { $image_width = round($content_width / 100 * $grid_width - 66); } break; case 'half-with-image': $image_width = 537; break; case 'half-without-image': $image_width = 537; break; case 'fourth-with-image': $image_width = 262; break; case 'fourth-without-image': $image_width = 262; default: } $output = '<article id="' . get_the_ID() . '" style="height:' . ($image_height + 2) . 'px" class="mk-news-item news-' . $item_id . ' mk-isotop-item news-' . $post_style . '">'; switch ($post_style) { case 'full-with-image': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_src = bfi_thumb($image_src_array[0], array('width' => $image_width, 'height' => $image_height)); if (has_post_thumbnail()) { $output .= '<img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . $image_src . '" itemprop="image" />'; } $output .= '<span class="news-date">' . get_the_date() . '</span>'; $output .= '<div class="news-meta-wrapper">'; $output .= '<div class="news-categories"><span>' . implode(' ', $terms_name) . '</span></div>'; $output .= '<div class="clearboth"></div>'; $output .= '<div class="news-the-title"><span><a href="' . get_permalink() . '">' . get_the_title() . '</a></span></div>'; $output .= '</div>'; break; case 'full-without-image': $output .= '<div class="news-meta-wrapper">'; $output .= '<div class="news-categories"><span>' . implode(' ', $terms_name) . '</span></div>'; $output .= '<div class="clearboth"></div>'; $output .= '<div class="news-the-title"><span><a href="' . get_permalink() . '">' . get_the_title() . '</a></span></div>'; $output .= '<span class="news-date">' . get_the_date() . '</span>'; $output .= '</div>'; $output .= '<div class="the-excerpt"><p>' . get_the_excerpt() . '</p></div>'; $output .= '<a href="' . get_permalink() . '" class="mk-read-more">' . __('Read more', 'mk_framework') . '<i class="mk-icon-double-angle-right"></i></a>'; break; case 'half-with-image': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_src = bfi_thumb($image_src_array[0], array('width' => $image_width, 'height' => $image_height)); if (has_post_thumbnail()) { $output .= '<img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . $image_src . '" itemprop="image" />'; } $output .= '<span class="news-date">' . get_the_date() . '</span>'; $output .= '<div class="news-meta-wrapper">'; $output .= '<div class="news-categories"><span>' . implode(' ', $terms_name) . '</span></div>'; $output .= '<div class="clearboth"></div>'; $output .= '<div class="news-the-title"><span><a href="' . get_permalink() . '">' . get_the_title() . '</a></span></div>'; $output .= '</div>'; break; case 'half-without-image': $output .= '<div class="news-meta-wrapper">'; $output .= '<div class="news-categories"><span>' . implode(' ', $terms_name) . '</span></div>'; $output .= '<div class="clearboth"></div>'; $output .= '<div class="news-the-title"><span><a href="' . get_permalink() . '">' . get_the_title() . '</a></span></div>'; $output .= '<span class="news-date">' . get_the_date() . '</span>'; $output .= '<div class="clearboth"></div>'; $output .= '</div>'; $output .= '<div class="the-excerpt"><p>' . get_the_excerpt() . '</p></div>'; $output .= '<a href="' . get_permalink() . '" class="mk-read-more">' . __('Read more', 'mk_framework') . '<i class="mk-icon-double-angle-right"></i></a>'; break; case 'fourth-with-image': $image_src_array = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full', true); $image_src = bfi_thumb($image_src_array[0], array('width' => $image_width, 'height' => $image_height)); if (has_post_thumbnail()) { $output .= '<img alt="' . get_the_title() . '" title="' . get_the_title() . '" src="' . $image_src . '" itemprop="image" />'; } $output .= '<span class="news-date">' . get_the_date() . '</span>'; $output .= '<div class="news-meta-wrapper">'; $output .= '<div class="news-categories"><span>' . implode(' ', $terms_name) . '</span></div>'; $output .= '<div class="clearboth"></div>'; $output .= '<div class="news-the-title"><span><a href="' . get_permalink() . '">' . get_the_title() . '</a></span></div>'; $output .= '</div>'; break; case 'fourth-without-image': $output .= '<div class="news-meta-wrapper">'; $output .= '<div class="news-categories"><span>' . implode(' ', $terms_name) . '</span></div>'; $output .= '<div class="clearboth"></div>'; $output .= '<div class="news-the-title"><span><a href="' . get_permalink() . '">' . get_the_title() . '</a></span></div>'; $output .= '<span class="news-date">' . get_the_date() . '</span>'; $output .= '</div>'; $output .= '<div class="the-excerpt"><p>' . get_the_excerpt() . '</p></div>'; $output .= '<a href="' . get_permalink() . '" class="mk-read-more">' . __('Read more', 'mk_framework') . '<i class="mk-icon-double-angle-right"></i></a>'; default: } $output .= '</article>'; return $output; }