function widget($args, $instance) { extract($args); $title = isset($instance['title']) ? $instance['title'] : ''; echo $before_widget; $search_type = yit_get_option('search_type'); if (!is_shop_installed() && $search_type == 'product') { $search_type = 'post'; } ?> <?php $icon = yit_get_option('header-search-mini-icon'); $image_attr = yit_getimagesize($icon['custom']); if ($icon['select'] == 'icon') { $i = '<i class="fa fa-' . $icon['icon'] . '"></i>'; } else { $i = '<span><img src="' . $icon['custom'] . '" ' . $image_attr[3] . ' alt="' . __("Search", "yit") . '"/></span>'; } ?> <a href="#" class="search_mini_button"><?php echo $i; ?> </a> <div class="search_mini_content slideInDown"> <?php echo yit_get_header_skin() == 'skin1' ? '<div class="container">' : ''; ?> <?php if (defined('YITH_WCAS')) { ?> <?php echo do_shortcode('[yith_woocommerce_ajax_search]'); ?> <?php } else { ?> <form action="<?php echo home_url('/'); ?> " method="get" class="search_mini"> <input type="text" name="s" id="search_mini" value="<?php the_search_query(); ?> " placeholder="<?php if (is_shop_installed()) { _e('search for products', 'yit'); } else { _e('search for...', 'yit'); } ?> " /><input type="submit" value="" id="mini-search-submit" /> <input type="hidden" name="post_type" value="<?php echo $search_type; ?> " /> </form> <?php } ?> <?php echo yit_get_header_skin() == 'skin1' ? '</div>' : ''; ?> </div> <?php echo $after_widget; }
$title = ( isset( $title ) ) ? $title : ''; $subtitle = ( isset( $subtitle ) ) ? $subtitle : ''; $image = ( isset( $image ) ) ? esc_url( $image ) : ''; $link = ( isset( $link ) ) ? esc_url( $link ) : ''; $slogan_position = ( isset( $slogan_position ) ) ? $slogan_position : ''; $button = ( isset( $button ) ) ? $button : ''; $button_class = ( isset( $button ) && $button != '' ) ? 'with_button' : 'no-button'; $button_style = ( isset( $button_style ) ) ? $button_style : ''; $title_color = ( isset( $title_color ) ) ? $title_color : '#000000'; $title_size = ( isset( $title_size ) ) ? $title_size : '24'; $subtitle_color = ( isset( $subtitle_color ) ) ? $subtitle_color : '#000000'; $subtitle_size = ( isset( $subtitle_size ) ) ? $subtitle_size : '15'; if ( $image != '' ) { $attachment_image_id = yit_plugin_get_attachment_id( $image ); $attachment_image_info = yit_getimagesize( $image ); } $animate_data = ( $animate != '' ) ? 'data-animate="' . $animate . '"' : ''; $animate_data .= ( $animation_delay != '' ) ? ' data-delay="' . $animation_delay . '"' : ''; $animate = ( $animate != '' ) ? ' yit_animate' : ''; ?> <?php if ( $image != '' ) : ?> <div class="teaser-wrapper <?php echo esc_attr( $animate . $vc_css . ' '. $button_class ) ?>" <?php echo $animate_data ?>> <div class="image" > <img src="<?php yit_image( "id={$attachment_image_id}&size=teaser_widget&output=url" ) ?>"> <div class="image_banner_inside" style="height: <?php echo $attachment_image_info[1] ?>px;"> <div class="image_banner_text <?php echo $slogan_position ?>"> <?php if( $link != '' && $button == '' ) : ?> <a href="<?php echo $link ?>">
} $slider = YIT_Layout()->slider_name; $static_image = YIT_Layout()->static_image; ?><div class="slider-container"><?php if ( $static_image == 'yes' ) : $image_upload = YIT_Layout()->image_upload; $image_link = YIT_Layout()->image_link; $image_target = YIT_Layout()->image_target; $image_size = yit_getimagesize( $image_upload ); $image_id = yit_get_attachment_id( $image_upload ); list( $thumb_url, $image_width, $image_height ) = wp_get_attachment_image_src( $image_id ); //check if parallax effects is enabled $parallax = YIT_Layout()->parallax; if ( $parallax == 'yes' ): $height = YIT_Layout()->parallax_height; $color = YIT_Layout()->parallax_text_color; $hover_color = YIT_Layout()->parallax_link_color; $valign = YIT_Layout()->parallax_vertical_align; $halign = YIT_Layout()->parallax_horizontal_align; $effect = YIT_Layout()->parallax_effect; $content = YIT_Layout()->parallax_content; $overlay_opacity = YIT_Layout()->parallax_overlay_opacity;
* * @package WordPress * @subpackage Your Inspiration Themes * @author Your Inspiration Themes Team <*****@*****.**> * * This source file is subject to the GNU GENERAL PUBLIC LICENSE (GPL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://www.gnu.org/licenses/gpl-3.0.txt */ global $post; $post_id = yit_post_id(); // use static header image if (isset($post_id) && yit_get_post_meta($post_id, '_use_static_image')) { $image_url = yit_get_post_meta($post_id, '_static_image'); $image_size = yit_getimagesize($image_url); $image_id = yit_get_attachment_id($image_url); $image = wp_get_attachment_image_src($image_id); if (count($image) != 3) { list($thumb_url, $image_width, $image_height) = $image; } else { $thumb_url = $image_width = $image_height = ''; } $static_image_link = yit_get_post_meta($post_id, '_static_image_link'); ?> <div class="slider fixed-image inner group"> <div class="fixed-image-wrapper" <?php if (!empty($image_size)) { ?> style="max-width: <?php echo $image_size[0];
function widget( $args, $instance ) { extract( $args ); $title = apply_filters('widget_title', $instance['title'] ); echo $before_widget; if ( $title ) echo $before_title . $title . $after_title; if( $instance['autop'] ) { $instance['text'] = wpautop( $instance['text'] ); } $text = '<div class="text-image" style="text-align:'. $instance['align'] .'">'; if (isset($instance['image']) && $instance['image'] != '') : if( isset($instance['image_link']) && $instance['image_link'] != '' ) { $text.= '<a href="' . $instance['image_link'] . '">'; } $image_id = yit_get_attachment_id( $instance['image'] ); $image_meta = get_post_meta( $image_id, '_wp_attachment_image_alt', true ); $size = yit_getimagesize($instance['image']); $size = ( !empty($size) && isset($size[3] ) ) ? $size[3] : ''; $text .= '<img src="' . $instance['image'] . '" alt="' . $image_meta . '" '. $size . ' />'; if( isset($instance['image_link']) && $instance['image_link'] != '' ) { $text.= '</a>'; } endif; //string translation fix $clear_text = apply_filters( 'widget_text', yit_wpml_string_translate( 'Widgets', 'widget_text_' . sanitize_title( $instance['text'] ), $instance['text'] ), $instance ); $text .= '</div>' .$clear_text; echo $text; echo $after_widget; }
function yit_get_add_to_cart_slideup($arg) { $img = yit_get_option('shop-slide-add-cart-icon') != '' ? yit_get_option('shop-slide-add-cart-icon') : get_template_directory_uri() . '/images/ico-cart.png'; $image_size = yit_getimagesize($img); $button = '<img src="' . $img . '" alt="ico-cart" class="ico-cart" height="' . $image_size[1] . '" width="' . $image_size[0] . '"/>'; return $button; }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); if (strpos($before_widget, 'widget-wrap') === false) { $before_widget .= '<div class="widget-wrap">'; $after_widget .= '</div>'; } echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } echo '<div>'; if ($instance['autop']) { $instance['text'] = wpautop($instance['text']); } $text = '<div class="text-image" style="text-align:' . $instance['align'] . '">'; if (isset($instance['image']) && $instance['image'] != '') { $size = yit_getimagesize($instance['image']); $size = !empty($size) && isset($size[3]) ? $size[3] : ''; $text .= '<img src="' . preg_replace('/http(s)?:/', '', $instance['image']) . '" alt="' . $instance['title'] . '" ' . $size . ' />'; } $text .= '</div>' . $instance['text']; echo apply_filters('widget_text', $text); if (!empty($instance['link'])) { echo '<a href="' . $instance['link'] . '" class="widget-link"></a>'; } echo '</div>'; echo $after_widget; }
break; case "external": $link['url'] = apply_filters('external_add_to_cart_url', get_permalink($product->id)); $link['label'] = apply_filters('external_add_to_cart_text', __('Read More', 'yit')); break; default: if ($product->is_purchasable()) { $link['url'] = apply_filters('add_to_cart_url', esc_url($product->add_to_cart_url())); $link['label'] = apply_filters('add_to_cart_text', __('Add to cart', 'yit')); $link['class'] = apply_filters('add_to_cart_class', 'add_to_cart_button'); $link['quantity'] = apply_filters('add_to_cart_quantity', get_post_meta($product->id, 'minimum_allowed_quantity', true) ? get_post_meta($product->id, 'minimum_allowed_quantity', true) : 1); } else { $link['url'] = apply_filters('not_purchasable_url', get_permalink($product->id)); $link['label'] = apply_filters('not_purchasable_text', __('Read More', 'yit')); } break; } if ($yit_products_layout == 'slideup' && !(isset($_REQUEST['action']) && ($_REQUEST['action'] == 'yith-woocompare-view-table' || $_REQUEST['action'] == 'yith-woocompare-add-product' || $_REQUEST['action'] == 'yith-woocompare-remove-product')) && !(isset($in_swiper_slider) && $in_swiper_slider)) { if (!$product->is_in_stock()) { $img = yit_get_option('shop-slide-out-stock-icon') != '' ? yit_get_option('shop-slide-out-stock-icon') : get_template_directory_uri() . '/images/ico-outofstock.png'; } elseif ($handler == 'simple' || $handler == 'bundle') { $img = yit_get_option('shop-slide-add-cart-icon') != '' ? yit_get_option('shop-slide-add-cart-icon') : get_template_directory_uri() . '/images/ico-cart.png'; } elseif ($handler == 'variable' || $handler == 'grouped') { $img = yit_get_option('shop-slide-set-option-icon') != '' ? yit_get_option('shop-slide-set-option-icon') : get_template_directory_uri() . '/images/ico-view.png'; } $image_size = yit_getimagesize($img); echo apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" rel="nofollow" data-product_id="%s" data-quantity="%s" data-product_sku="%s" class="%s product_type_%s"><img src="' . $img . '" alt="ico-cart" class="ico-cart" height="' . $image_size[1] . '" width="' . $image_size[0] . '"/></a>', esc_url($link['url']), esc_attr($product->id), esc_attr($link['quantity']), esc_attr($product->get_sku()), esc_attr($link['class']), esc_attr($product->product_type)), $product, $link); } else { echo apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" rel="nofollow" data-product_id="%s" data-quantity="%s" data-product_sku="%s" class="%s btn %s product_type_%s">%s</a>', esc_url($link['url']), esc_attr($product->id), esc_attr($link['quantity']), esc_attr($product->get_sku()), esc_attr($link['class']), isset($in_swiper_slider) && $in_swiper_slider ? $button_class : "btn-alternative", esc_attr($product->product_type), esc_html($link['label'])), $product, $link); } }
function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title']); echo $before_widget; if ($title) { echo $before_title . $title . $after_title; } if ($instance['autop']) { $instance['text'] = wpautop($instance['text']); } $text = '<div class="text-image" style="text-align:' . $instance['align'] . '">'; if (isset($instance['image']) && $instance['image'] != '') { if (isset($instance['image_link']) && $instance['image_link'] != '') { $text .= '<a href="' . $instance['image_link'] . '">'; } $image_id = yit_get_attachment_id($instance['image']); $image_meta = get_post_meta($image_id, '_wp_attachment_image_alt', true); $size = yit_getimagesize($instance['image']); $size = !empty($size) && isset($size[3]) ? $size[3] : ''; $text .= '<img src="' . $instance['image'] . '" alt="' . $image_meta . '" ' . $size . ' />'; if (isset($instance['image_link']) && $instance['image_link'] != '') { $text .= '</a>'; } } $text .= '</div>' . $instance['text']; echo apply_filters('widget_text', $text); echo $after_widget; }
public function get_html() { ?> <div class="popupOverlay"></div> <div id="popupWrap" class="popupWrap span6"> <div class="popup"> <div class="border-1 border"> <div class="border-2 border"> <?php if ($this->title) { ?> <h3 class="title"><?php echo $this->title; ?> </h3> <div class="border borderstrong borderpadding container"></div> <div class="border container"></div> <div class="border container"></div> <div class="border container"></div> <?php } ?> <?php if ($this->image || $this->message || $this->newsletter) { ?> <div class="row"> <?php if ($this->image) { ?> <?php $size = yit_getimagesize($this->image); $size = !empty($size) && isset($size[3]) ? $size[3] : ''; ?> <div class="popup_img <?php echo $this->message || $this->newsletter ? "span2" : "span5"; ?> "><img alt="popup-image" src="<?php echo $this->image; ?> " <?php echo $size; ?> /></div> <?php } ?> <div class="popup_message <?php echo $this->image ? 'offset2' : 'span6 no-image'; ?> "> <?php echo do_shortcode($this->message); ?> <?php if (yit_get_option('popup_news_url')) { $action = yit_get_option('popup_news_url'); $email = yit_get_option('popup_news_email'); $email_label = yit_get_option('popup_news_email_label'); $email_icon = yit_get_option('popup_email_icon'); $hidden_fields = yit_get_option('popup_hidden_fields'); $submit = yit_get_option('popup_submit_text'); $method = yit_get_option('popup_method'); ?> <div class="popup-newsletter-section group"> <form method="<?php echo $method; ?> " action="<?php echo $action; ?> "> <fieldset class="row"> <ul class="group"> <li class="<?php if (!$this->image) { ?> offset2<?php } ?> "> <input type="text" name="<?php echo $email; ?> " id="<?php echo $email; ?> " class="email-field text-field autoclear" placeholder="<?php echo $email_label; ?> " /> </li> <li class="<?php if (!$this->image) { ?> offset2<?php } ?> "> <?php // hidden fileds if ($hidden_fields != '') { $hidden_fields = explode('&', $hidden_fields); foreach ($hidden_fields as $field) { list($id_field, $value_field) = explode('=', $field); echo '<input type="hidden" name="' . $id_field . '" value="' . $value_field . '" />'; } } echo wp_nonce_field('mc_submit_signup_form', '_mc_submit_signup_form_nonce', false, false); ?> <div class="input-prepend"> <input type="submit" value="<?php echo $submit; ?> " class="submit-field" /> </div> </li> </ul> </fieldset> </form> </div> <?php } ?> </div> </div> <?php } ?> <div class="row"> <div class="box-no-view span3"> <label for="no-view"><input type="checkbox" name="no-view" class="no-view" /><?php echo __('Do not show again', 'yit'); ?> </label> </div> </div> </div> </div> </div> <div class="close-popup"></div> </div> </div> <?php }
public function getOutput($item, $fieldId, $field) { if ($field['type'] == 'text') { return "<span class='custom-item-{$item->ID} custom-item-{$fieldId} custom-item-text'>" . $item->{$fieldId} . '</span>'; } elseif ($field['type'] == 'textarea') { return "<p class='custom-item-{$item->ID} custom-item-{$fieldId} custom-item-textarea'>" . $this->_parseString($item->{$fieldId}) . '</p>'; } elseif ($field['type'] == 'upload') { $img_url = $item->{$fieldId}; $img_array = yit_getimagesize($img_url); $img_size = $img_array != NULL ? $img_array[3] : ""; return "<a class='custom-item-{$item->ID} custom-item-{$fieldId} custom-item-image' href='" . esc_attr($item->url) . "'><img src='" . $img_url . "' alt='" . apply_filters('the_title', $item->title, $item->ID) . "' " . $img_size . " /></a>"; } }