"> <?php if ($img_ratio == 'off') { do_action('woocommerce_before_subcategory_title', $category); } else { $thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true); if ($thumbnail_id) { $image_cat_url = wp_get_attachment_image_src($thumbnail_id, 'full'); $image_cat_url = $image_cat_url[0]; $cat_image = aq_resize($image_cat_url, $catimgwidth, $catimgheight, true); if (empty($cat_image)) { $cat_image = $image_cat_url; } } else { $cat_image = virtue_img_placeholder(); } if ($cat_image) { echo '<img src="' . esc_url($cat_image) . '" alt="' . esc_attr($category->name) . '" />'; } } ?> <h5> <?php echo $category->name; if ($category->count > 0) { echo apply_filters('woocommerce_subcategory_count_html', ' <mark class="count">(' . $category->count . ')</mark>', $category); } ?> </h5>
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); if (!empty($instance["description"])) { $description = $instance["description"]; } else { $description = ''; } if (!empty($instance['image_uri'])) { $image = esc_url($instance['image_uri']); } else { $image = virtue_img_placeholder(); } if (!empty($instance["height"])) { $height = $instance["height"]; } else { $height = '210'; } if (!empty($instance["link"])) { $link = $instance["link"]; } else { $link = '#'; } if (!empty($instance["target"]) && $instance["target"] == 'true') { $linktarget = 'target="_blank"'; } else { $linktarget = ''; } ?> <?php echo $before_widget; ?> <div class="kad-animation" data-animation="fade-in" data-delay="<?php echo 1 * 150; ?> "> <?php if ($link != '') { echo '<a href="' . $link . '" ' . $linktarget . ' class="homepromolink">'; } ?> <div class="infobanner" style="background: url(<?php echo $image; ?> ) center center no-repeat; height:<?php echo $height; ?> px; <?php if (empty($imgheight)) { echo 'background-size:cover;'; } ?> "> <div class="home-message" style="height:<?php echo $height; ?> px;"> <?php if (!empty($title)) { echo '<h4>' . $title . '</h4>'; } ?> <?php if (!empty($description)) { echo '<h5>' . $description . '</h5>'; } ?> </div> </div> <?php if ($link != '') { echo '</a>'; } ?> </div> <?php echo $after_widget; ?> <?php }
public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', empty($instance['title']) ? '' : $instance['title'], $instance, $this->id_base); if (!empty($instance["description"])) { $description = $instance["description"]; } else { $description = ''; } if (!empty($instance['image_url'])) { $image = esc_url($instance['image_url']); } else { $image = virtue_img_placeholder(); } if (!empty($instance["img_link"])) { $img_link = 'image_link="' . $instance["img_link"] . '" '; } else { $img_link = ''; } if (!empty($instance["img_align"])) { $img_align = 'imageside="' . $instance["img_align"] . '" '; } else { $img_align = ''; } if (!empty($instance['img_background_color'])) { $img_background_color = 'img_background="' . $instance['img_background_color'] . '" '; } else { $img_background_color = ''; } if (!empty($instance['content_background_color'])) { $content_background_color = 'content_background="' . $instance['content_background_color'] . '" '; } else { $content_background_color = ''; } if (!empty($instance["height"])) { $height = $instance["height"]; } else { $height = '500'; } if (!empty($instance["btn_text"])) { $btn_text = $instance["btn_text"]; } else { $btn_text = ''; } if (!empty($instance["btn_link"])) { $btn_link = $instance["btn_link"]; } else { $btn_link = '#'; } if (!empty($instance["link_target"])) { $linktarget = 'target="' . $instance["link_target"] . '"'; } else { $linktarget = ''; } ?> <?php echo $before_widget; ?> <?php $output = '[kt_imgsplit image="' . $image . '" height="' . $height . '" ' . $img_align . ' ' . $img_background_color . ' ' . $img_link . ' ' . $linktarget . ' ' . $content_background_color . ']'; if (!empty($title)) { $output .= '<h2 class="kt_imgsplit_title">' . $title . '</h2>'; } if (!empty($description)) { $output .= '<div class="kt_imgsplit_content">' . $description . '</div>'; } if (!empty($btn_text)) { $output .= '<a href="' . $btn_link . '" class="kt_imgsplit_btn kad-btn kad-btn-primary">' . $btn_text . '</a>'; } $output .= '[/kt_imgsplit]'; echo do_shortcode($output); ?> <?php echo $after_widget; ?> <?php }
function kad_image_menu_shortcode_function($atts, $content) { extract(shortcode_atts(array('height' => '110', 'height_setting' => 'normal', 'image' => '', 'title' => '', 'columns' => '3', 'link' => '', 'target' => '', 'description' => ''), $atts)); if (!empty($target)) { $linktarget = 'target="' . $target . '"'; } else { $linktarget = ''; } if (empty($image)) { $image = virtue_img_placeholder(); } if ($columns == '2') { $itemsize = 'tcol-lg-6 tcol-md-6 tcol-sm-6 tcol-xs-12 tcol-ss-12'; $width = 559; } else { if ($columns == '1') { $itemsize = ''; $width = null; } else { if ($columns == '3') { $itemsize = 'tcol-lg-4 tcol-md-4 tcol-sm-4 tcol-xs-6 tcol-ss-12'; $width = 367; } else { if ($columns == '6') { $itemsize = 'tcol-lg-2 tcol-md-2 tcol-sm-3 tcol-xs-4 tcol-ss-6'; $width = 240; } else { if ($columns == '5') { $itemsize = 'tcol-lg-25 tcol-md-25 tcol-sm-3 tcol-xs-4 tcol-ss-6'; $width = 240; } else { $itemsize = 'tcol-lg-3 tcol-md-3 tcol-sm-4 tcol-xs-6 tcol-ss-12'; $width = 270; } } } } } ob_start(); ?> <?php if ($height_setting == 'imgsize') { $the_image = aq_resize($image, $width, null, false, false); if (empty($the_image[0])) { $the_image[0] = $image; $the_image[1] = null; $the_image[2] = null; } ?> <div class="<?php echo esc_attr($itemsize); ?> kad-animation image-menu-image-size" data-animation="fade-in" data-delay="150"> <?php if (!empty($link)) { echo '<a href="' . esc_attr($link) . '" class="homepromolink" target="' . esc_attr($target) . '">'; } ?> <div class="image_menu_hover_class"></div> <img src="<?php echo esc_url($the_image[0]); ?> " width="<?php echo esc_attr($the_image[1]); ?> " height="<?php echo esc_attr($the_image[2]); ?> " alt="<?php echo esc_attr($title); ?> " /> <div class="image_menu_content"> <div class="image_menu_message"> <?php if (!empty($title)) { echo '<h4>' . $title . '</h4>'; } ?> <?php if (!empty($description)) { echo '<h5>' . $description . '</h5>'; } ?> </div> </div> <?php if (!empty($link)) { echo '</a>'; } ?> </div> <?php } else { $the_image = aq_resize($image, $width, $height, true); if (empty($the_image)) { $the_image = $image; } ?> <div class="<?php echo esc_attr($itemsize); ?> kad-animation" data-animation="fade-in" data-delay="150"> <?php if (!empty($link)) { echo '<a href="' . esc_url($link) . '" ' . esc_attr($linktarget) . ' class="homepromolink">'; } ?> <div class="infobanner" style="background: url(<?php echo esc_url($the_image); ?> ) center center no-repeat; height:<?php echo esc_attr($height); ?> px; <?php echo 'background-size:cover;'; ?> "> <div class="home-message" style="height:<?php echo esc_attr($height); ?> px;"> <?php if (!empty($title)) { echo '<h4>' . $title . '</h4>'; } ?> <?php if (!empty($description)) { echo '<h5>' . $description . '</h5>'; } ?> </div> </div> <?php if (!empty($link)) { echo '</a>'; } ?> </div> <?php } $output = ob_get_contents(); ob_end_clean(); return $output; }
function kad_image_menu_shortcode_function($atts, $content) { extract(shortcode_atts(array('height' => '', 'image' => '', 'title' => '', 'columns' => '', 'link' => '', 'target' => '', 'description' => ''), $atts)); if (empty($height)) { $height = 110; } $imgheight = $height; if (empty($columns)) { $columns = 3; } if (!empty($target)) { $linktarget = 'target="' . $target . '"'; } else { $linktarget = ''; } if (empty($image)) { $image = virtue_img_placeholder(); } if ($columns == '2') { $itemsize = 'tcol-lg-6 tcol-md-6 tcol-sm-6 tcol-xs-12 tcol-ss-12'; $width = 559; } else { if ($columns == '1') { $itemsize = ''; $width = null; $imgheight = null; } else { if ($columns == '3') { $itemsize = 'tcol-lg-4 tcol-md-4 tcol-sm-4 tcol-xs-6 tcol-ss-12'; $width = 367; } else { if ($columns == '6') { $itemsize = 'tcol-lg-2 tcol-md-2 tcol-sm-3 tcol-xs-4 tcol-ss-6'; $width = 240; } else { if ($columns == '5') { $itemsize = 'tcol-lg-25 tcol-md-25 tcol-sm-3 tcol-xs-4 tcol-ss-6'; $width = 240; } else { $itemsize = 'tcol-lg-3 tcol-md-3 tcol-sm-4 tcol-xs-6 tcol-ss-12'; $width = 270; } } } } } $counter = 1; ob_start(); ?> <?php $the_image = aq_resize($image, $width, $imgheight, true); if (empty($the_image)) { $the_image = $image; } ?> <div class="<?php echo $itemsize; ?> kad-animation" data-animation="fade-in" data-delay="<?php echo $counter * 150; ?> "> <?php if ($link != '') { echo '<a href="' . $link . '" ' . $linktarget . ' class="homepromolink">'; } ?> <div class="infobanner" style="background: url(<?php echo $the_image; ?> ) center center no-repeat; height:<?php echo $height; ?> px; <?php if (empty($imgheight)) { echo 'background-size:cover;'; } ?> "> <div class="home-message" style="height:<?php echo $height; ?> px;"> <?php if (!empty($title)) { echo '<h4>' . $title . '</h4>'; } ?> <?php if (!empty($description)) { echo '<h5>' . $description . '</h5>'; } ?> </div> </div> <?php if ($link != '') { echo '</a>'; } ?> </div> <?php $output = ob_get_contents(); ob_end_clean(); return $output; }