function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); echo $before_widget; $title = empty($instance['title']) ? '' : apply_filters('widget_title', $instance['title']); $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']); $category = empty($instance['category']) ? '' : apply_filters('widget_category', $instance['category']); $number = empty($instance['number']) ? '5' : apply_filters('widget_number', $instance['number']); $post_type = empty($instance['post_type']) ? 'post' : apply_filters('widget_post_type', $instance['post_type']); ?> <?php if ($title) { ?> <h3 class="i_publication"><?php echo $title; ?> </h3> <?php } ?> <ul class="latest_posts"> <?php global $post; if ($category) { $arg = "&category={$category}"; } $arg = "&post_type={$post_type}"; $today_special = get_posts('numberposts=' . $number . $arg); foreach ($today_special as $post) { setup_postdata($post); ?> <?php $post_images = bdw_get_images($post->ID); ?> <li> <?php if (get_the_post_thumbnail($post->ID)) { ?> <a class="post_img" href="<?php the_permalink(); ?> "> <?php echo get_the_post_thumbnail($post->ID, array(50, 50), array('class' => "")); ?> </a> <?php } elseif ($post_images = bdw_get_images($post->ID)) { ?> <a class="post_img" href="<?php the_permalink(); ?> "> <img src="<?php echo templ_thumbimage_filter(get_post_meta($post->ID, 'file_name', true), 50, 50, 1); ?> " alt="<?php the_title(); ?> " title="<?php the_title(); ?> " width="50" height="50" /> </a> <?php } ?> <h4> <a class="widget-title" href="<?php the_permalink(); ?> "> <?php the_title(); ?> </a> <br /> <span class="post_author">by <?php the_author_posts_link(); ?> at <?php echo $post->post_date; ?> / <?php comments_popup_link(__('No Comments', 'templatic'), __('1 Comment', 'templatic'), __('% Comments', 'templatic'), '', __('Comments Closed', 'templatic')); ?> </span></h4> <p> <?php echo bm_better_excerpt(175, ''); ?> <a href="<?php the_permalink(); ?> "> <?php _e('more...', 'templatic'); ?> </a></p> </li> <?php } ?> </ul> <?php echo $after_widget; }
function templ_anything_slider_class_fun($post) { ob_start(); // don't remove this code ///////////////////////////////////////////////////// if (get_the_post_thumbnail($post->ID, array())) { ?> <a class="post_img" href="<?php echo get_permalink($post->ID); ?> "><?php echo get_the_post_thumbnail($post->ID, array(220, 220), array('class' => "")); ?> </a> <?php } else { if ($post_images = bdw_get_images($post->ID, 'large')) { global $thumb_url; $crop_image = vt_resize('', $post_images[0], 220, 220, $crop = true); $imgurl = $crop_image['url']; ?> <a class="post_img" href="<?php echo get_permalink($post->ID); ?> "><img src="<?php echo $imgurl; ?> " alt="<?php echo get_the_title($post->ID); ?> " title="<?php echo get_the_title($post->ID); ?> " /></a> <?php } } ?> <div class="tslider3_content"> <h3> <a class="widget-title" href="<?php echo get_permalink($post->ID); ?> "><?php echo get_the_title($post->ID); ?> </a></h3> <p><?php echo bm_better_excerpt(605, ' ... '); ?> </p> <p><a href="<?php echo get_permalink($post->ID); ?> " class="more"><?php _e('Read More', 'templatic'); ?> </a></p> </div> <?php ///////////////////////////////////////////////////// $return = ob_get_contents(); // don't remove this code ob_end_clean(); // don't remove this code return $return; }
function widget($args, $instance) { // prints the widget extract($args, EXTR_SKIP); echo $before_widget; $category = empty($instance['category']) ? ' ' : apply_filters('widget_category', $instance['category']); $post_number = empty($instance['post_number']) ? ' ' : apply_filters('widget_post_number', $instance['post_number']); $post_link = empty($instance['post_link']) ? ' ' : apply_filters('widget_post_link', $instance['post_link']); $auto_rotate = empty($instance['auto_rotate']) ? 'Yes' : apply_filters('widget_auto_rotate', $instance['auto_rotate']); $speed = empty($instance['speed']) ? '5000' : apply_filters('widget_speed', $instance['speed']); $image_width = empty($instance['image_width']) ? '420' : apply_filters('widget_image_width', $instance['image_width']); $image_height = empty($instance['image_height']) ? '' : apply_filters('widget_image_height', $instance['image_height']); $content_lenght = empty($instance['content_lenght']) ? '700' : apply_filters('widget_content_lenght', $instance['content_lenght']); if ($auto_rotate == 'No') { $speed = '100000'; } ?> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?> /library/js/jquery.easing.1.3.js"></script> <script type="text/javascript" src="<?php bloginfo('template_directory'); ?> /library/js/slider.js"></script> <?php echo "<script type='text/javascript'>\n\t\t\tvar autoSlider_var = '" . $auto_rotate . "';\n\t\t\tvar autoSlideInterval_var = '" . $speed . "';\n\t\t\t</script>"; if (!empty($title)) { echo $before_title . $title . $after_title; } echo '<div id="banner"> <div class="banner-in container_16 clearfix"> <div id="slider"> <div class="coda-slider-wrapper"><div class="coda-slider preload" id="coda-slider-1">'; ?> <?php global $post; $latest_menus = get_posts('numberposts=' . $post_number . 'postlink=' . $post_link . '&category=' . $category . ''); foreach ($latest_menus as $post) { setup_postdata($post); $button = get_post_meta($post->ID, 'button', $single = true); $button_url = get_post_meta($post->ID, 'button_url', $single = true); ?> <div class="panel"> <div class="panel-wrapper"> <?php global $Product; $product_image_arr = $Product->get_product_image($post, 'medium'); if ($product_image_arr && $product_image_arr[0]) { $imagepath = $product_image_arr[0]; } if ($imagepath) { ?> <div class="banner_img "> <a href="<?php the_permalink(); ?> "><img src="<?php echo bloginfo('template_url'); ?> /thumb.php?src=<?php echo $imagepath; if ($image_height > 0) { ?> &h=<?php echo $image_height; } ?> &w=<?php echo $image_width; ?> &zc=0&q=80" alt="" /></a> </div> <?php } ?> <h1><a class="widget-title" href="<?php the_permalink(); ?> "> <?php the_title(); ?> </a> </h1> <p class="featured-excerpt"><?php echo bm_better_excerpt($content_lenght, ' ... '); ?> </p> <div class="button"><a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?> ">Ver Detalhes</a> </div> </div> </div> <?php } echo '</div></div> </div> </div> </div> '; echo $after_widget; }
function product_listing_li_shorted($post, $display_order, $args = array()) { global $Product, $General, $thumb_url; $image_width = $this->get_image_width($post->image_width); $image_height = $this->get_image_height($post->image_height); $product_image_arr = $this->get_product_image($post, 'large'); $data = get_post_meta($post->ID, 'key', true); $product_price = $Product->get_product_price($post->ID); $content_strt_str = ''; $content_strt_end = ''; foreach ($display_order as $key => $val) { if ($key == 'image') { $is_image_border = 0; if (is_category()) { if (get_option('ptthemes_prdlstcatimage_border')) { $is_image_border = 1; } } elseif (is_home() && $_REQUEST['ptype'] == 'store') { if (get_option('ptthemes_prdlistimage_border')) { $is_image_border = 1; } } else { if (get_option('ptthemes_prdlsthomeimage_border')) { $is_image_border = 1; } } ?> <a href="<?php the_permalink(); ?> " class="product_thumb" style="width:<?php echo $image_width; ?> px; height:<?php echo $image_height; ?> px"> <?php if ($Product->get_product_price_sale($post->ID) > 0) { ?> <img src="<?php echo get_stylesheet_directory_uri(); ?> /images/sale.png" alt="" class="sale_img" /> <?php } ?> <?php $thumb_url .= $this->get_image_cutting_edge($args); ?> <img src="<?php echo bloginfo('template_url'); ?> /thumb.php?src=<?php echo $product_image_arr[0]; ?> &w=<?php echo $image_width; ?> &h=<?php echo $image_height; ?> &zc=1&q=80<?php echo $thumb_url; ?> " alt="" <?php if ($is_image_border) { ?> border="1"<?php } ?> /></a> <?php } if (($key == 'title' || $key == 'content' || $key == 'price' || $key == 'button') && $content_strt_str == '') { echo $content_strt_str = '<div class="content">'; //$content_strt_end = '</div>'; } if ($key == 'title') { ?> <h3><a href="<?php the_permalink(); ?> " title="Permanent Link to <?php the_title_attribute(); ?> "><?php the_title(); ?> </a></h3><?php } else { if ($key == 'content') { ?> <p class="contentp"><?php echo bm_better_excerpt(200, ' ... '); ?> </p><?php } else { if ($key == 'price') { ?> <p class="sale_price" > <?php if ($Product->get_product_price_sale($post->ID) > 0) { echo '<s>' . $General->get_amount_format($Product->get_product_price_only($post->ID)) . '</s> '; echo '<b>' . $General->get_amount_format($Product->get_product_price_sale($post->ID)) . '</b>'; } else { if ($Product->get_product_price_only($post->ID)) { if ($General->is_storetype_catalog()) { if ($Product->get_product_price_only($post->ID) > 0) { echo $General->get_amount_format($Product->get_product_price_only($post->ID)); } } else { echo $General->get_amount_format($Product->get_product_price_only($post->ID)); } } } ?> </p> <?php } else { if ($key == 'button') { ?> <div class="viewdetails"> <a href="<?php the_permalink(); ?> " title="<?php the_title_attribute(); ?> " class="highlight_button fl"><?php _e('Ver Detalhes'); ?> </a> </div><?php } } } } ?> <?php } ?> </div> <?php }