function widget($args, $instance)
 {
     extract($args);
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $category = $instance['category'];
     $number = $instance['number'];
     $column_class = 'columns-3';
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Display the widget title if one was input (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     /* Display Dribbble */
     if (!$number) {
         $number = -1;
     }
     $unique_id = "unique_id_" . rand(1, 50000);
     if ($category != "") {
         $loop = new WP_Query(array('post_type' => __('portfolio', 'hbthemes'), 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => $number, 'tax_query' => array(array('taxonomy' => 'portfolio_categories', 'field' => 'id', 'terms' => $category))));
     } else {
         $loop = new WP_Query(array('post_type' => __('portfolio', 'hbthemes'), 'orderby' => 'menu_order', 'order' => 'ASC', 'posts_per_page' => $number));
     }
     if ($number == 1 || $number == -1) {
         $column_class = 'columns-1';
     }
     if ($number == 2) {
         $column_class = 'columns-2';
     }
     if ($number == 3 || $number == 6 || $number == 9 || $number == 15 || $number == 18) {
         $column_class = 'columns-3';
     }
     if ($number == 4 || $number == 8 || $number == 12 || $number == 16 || $number == 24) {
         $column_class = 'columns-4';
     }
     echo '<div class="hb-stream ' . $column_class . ' clearfix" id="' . $unique_id . '"><ul>';
     $counter = (int) $number;
     if ($loop->have_posts()) {
         while ($loop->have_posts()) {
             $loop->the_post();
             $thumb = get_post_thumbnail_id();
             $image = hb_resize($thumb, '', 250, 250, true);
             if ($thumb) {
                 $counter--;
                 if ($counter >= 0) {
                     echo '<li><a href="' . get_permalink() . '" title="' . get_the_title() . '" rel="tooltip">';
                     echo '<img src="' . $image['url'] . '" width="' . $image['width'] . '" height="' . $image['height'] . '" />';
                     echo '</a></li>';
                 }
             }
         }
     }
     wp_reset_query();
     echo '</ul></div>';
     /* After widget (defined by themes). */
     echo $after_widget;
 }
			</script>
		</div>
		<?php 
        break;
    default:
        ?>
		<?php 
        // get featured image
        $thumb = get_post_thumbnail_id();
        $image_height = hb_options('hb_blog_image_height');
        $image_width = 1140;
        $full_image = wp_get_attachment_image_src($thumb, 'full', false);
        if (vp_metabox('layout_settings.hb_page_layout_sidebar')) {
            $image_width = 832;
        }
        $image = hb_resize($thumb, '', $image_width, $image_height, true);
        if ($image) {
            ?>
		<div class="featured-image">
			<a data-title="<?php 
            the_title();
            ?>
" href="<?php 
            echo $full_image[0];
            ?>
" rel="prettyPhoto">
				<img src="<?php 
            echo $image['url'];
            ?>
" alt="<?php 
            the_title();
Exemple #3
0
    } else {
        if (time() - 60 * 60 * 24 * $newness < $postdatestamp) {
            echo '<span class="wc-new-badge">' . __('New', 'hbthemes') . '</span>';
        }
    }
}
?>

	<?php 
if (has_post_thumbnail()) {
    $image_title = get_the_title();
    $image_link = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
    $image_object = get_post_thumbnail_id();
    $attachment_count = count($product->get_gallery_attachment_ids());
    $image_object = get_post_thumbnail_id();
    $image_cropped = hb_resize($image_object, '', 547, 547, true);
    $image = $image_link;
    $image_print = '<img class="hb-woo-featured-image" src="' . $image_cropped['url'] . '" width="' . $image_cropped['width'] . '" height="' . $image_cropped['height'] . '">';
    if ($attachment_count > 0) {
        $gallery = '[product-gallery]';
    } else {
        $gallery = '';
    }
    echo apply_filters('woocommerce_single_product_image_html', sprintf('<a href="%s" itemprop="image" class="woocommerce-main-image zoom" data-title="%s" rel="prettyPhoto' . $gallery . '">%s</a>', $image_link[0], $image_title, $image_print), $post->ID);
} else {
    echo apply_filters('woocommerce_single_product_image_html', sprintf('<img src="%s" alt="Placeholder" />', wc_placeholder_img_src()), $post->ID);
}
?>

	<?php 
do_action('woocommerce_product_thumbnails');
Exemple #4
0
			<h4 class="hb-heading hb-center-heading alt-color-1"><span><?php 
    _e('Meet More Team Members', 'hbthemes');
    ?>
</span></h4>
		</div>
	</div>

	<!-- BEGIN .related-portfolio-items -->
	<div class="row related-members">
	<?php 
    while ($related_items->have_posts()) {
        $related_items->the_post();
        ?>
		<?php 
        $thumb = get_post_thumbnail_id();
        $image = hb_resize($thumb, '', 270, 270, true);
        if ($image) {
            ?>
			<div class="col-3">
				<div class="team-member-box">
			
					<div class="team-member-img">
						<a href="<?php 
            the_permalink();
            ?>
"><img src="<?php 
            echo $image['url'];
            ?>
" alt="<?php 
            the_title();
            ?>
Exemple #5
0
 */
do_action('woocommerce_before_shop_loop_item_title');
if (get_the_post_thumbnail()) {
    $image_object = get_post_thumbnail_id();
    $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
    $image_link = wp_get_attachment_url(get_post_thumbnail_id());
    $image = hb_resize($image_object, '', 526, 700, true);
    echo '<div class="woo-category-wrap"><img src="' . $image["url"] . '" width="' . $image["width"] . '" height="' . $image["height"] . '"></div>';
} else {
    echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="526" height="700" />';
}
$product_gallery = get_post_meta($post->ID, '_product_image_gallery', true);
if (!empty($product_gallery)) {
    $gallery = explode(',', $product_gallery);
    $image_id = $gallery[0];
    $image_src_hover = hb_resize($image_id, '', 526, 700, true);
    echo '<img src="' . $image_src_hover['url'] . '" alt="' . get_the_title() . '" class="product-hover-image" title="' . get_the_title() . '">';
}
$postdate = get_the_time('Y-m-d');
// Post date
$postdatestamp = strtotime($postdate);
// Timestamped post date
$newness = 3;
// Newness in days
if ($product->sale_price) {
    // Sale will be added through action hook
} else {
    if (hb_is_out_of_stock()) {
        echo '<span class="out-of-stock-badge">' . __('Sold out', 'hbthemes') . '</span>';
    } else {
        if (time() - 60 * 60 * 24 * $newness < $postdatestamp) {
</h4>
	<?php 
    }
    ?>
					
	<div class="row">
	<?php 
    while ($related_posts->have_posts()) {
        $related_posts->the_post();
        ?>

		<!-- BEGIN .related-item -->
		<div class="col-4 related-item">
		<?php 
        $thumb = get_post_thumbnail_id();
        $image = hb_resize($thumb, '', 300, 200, true);
        if ($image) {
            ?>
				<div class="featured-image">
					<a href="<?php 
            the_permalink();
            ?>
">
						<img alt="<?php 
            the_title();
            ?>
" title="<?php 
            the_title();
            ?>
" src="<?php 
            echo $image['url'];
Exemple #7
0
    function widget($args, $instance)
    {
        extract($args);
        global $wp_query;
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $number = $instance['number'];
        $order = $instance['order'];
        $orderby = $instance['orderby'];
        /* Before widget (defined by themes). */
        echo $before_widget;
        /* Display the widget title if one was input (before and after defined by themes). */
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        ?>

		<?php 
        if (!$number) {
            $number = -1;
        }
        $testimonials = new WP_Query(array('post_type' => 'hb_testimonials', 'posts_per_page' => $number, 'orderby' => $orderby, 'order' => $order));
        $rand_num = rand(1, 100000);
        if ($testimonials->have_posts()) {
            ?>
			<div id="hb-testimonial-<?php 
            echo $rand_num;
            ?>
" class="ts-1">
				<ul class="testimonial-slider">
				<?php 
            while ($testimonials->have_posts()) {
                $testimonials->the_post();
                ?>
					<li class="hb-testimonial-box">
						<div class="hb-testimonial">
							<?php 
                the_content();
                ?>
						</div>
						
						<?php 
                $author_image = vp_metabox('testimonial_type_settings.hb_testimonial_author_image');
                $author_name = vp_metabox('testimonial_type_settings.hb_testimonial_author');
                $author_desc = vp_metabox('testimonial_type_settings.hb_testimonial_description');
                $author_desc_link = vp_metabox('testimonial_type_settings.hb_testimonial_description_link');
                if ($author_image) {
                    $author_image = hb_resize(null, $author_image, 60, 60, true);
                    ?>
							<img src="<?php 
                    echo $author_image['url'];
                    ?>
" width="60" height="60" class="testimonial-author-img"/>
						<?php 
                }
                ?>

						<?php 
                if ($author_name || $author_desc) {
                    ?>
						<div class="testimonial-author">
							<?php 
                    if ($author_name) {
                        ?>
							<h5 class="testimonial-author-name">
							<?php 
                        echo $author_name;
                        ?>
							</h5>
							<?php 
                    }
                    ?>

							<?php 
                    if ($author_desc && $author_desc_link) {
                        ?>
								<a href="<?php 
                        echo $author_desc_link;
                        ?>
" class="testimonial-company"><?php 
                        echo $author_desc;
                        ?>
</a>
							<?php 
                    } else {
                        if ($author_desc) {
                            ?>
								<a class="testimonial-company"><?php 
                            echo $author_desc;
                            ?>
</a>
							<?php 
                        }
                    }
                    ?>
						</div>
						<?php 
                }
                ?>
					</li>
				<?php 
            }
            ?>
				</ul>
			</div>

			<script type="text/javascript">
				jQuery(document).ready(function() {
					jQuery(window).on("load",function () {
						jQuery("#hb-testimonial-<?php 
            echo $rand_num;
            ?>
").flexslider({
							selector: ".testimonial-slider > li",
							slideshow: true,
							animation: "fade",
							smoothHeight: false,
							slideshowSpeed: 5000,
							animationSpeed: 350,
							directionNavArrowsLeft : '<i class="icon-chevron-left"></i>',
							directionNavArrowsRight : '<i class="icon-chevron-right"></i>',
							pauseOnHover: false,
							controlNav: true,
							directionNav:false,
							prevText: "",
							nextText: ""
						});
					});
				});
			</script>
		<?php 
        }
        wp_reset_query();
        ?>

		<?php 
        echo $after_widget;
    }
Exemple #8
0
<article id="post-<?php 
the_ID();
?>
" <?php 
if (has_post_thumbnail()) {
    post_class('image-post-type with-featured-image');
} else {
    post_class('image-post-type');
}
?>
 itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
	<?php 
// get featured image
$thumb = get_post_thumbnail_id();
if ($thumb) {
    $image = hb_resize($thumb, '', 900, 500, true);
    if ($image) {
        ?>
	
	<div class="featured-image">
		<a href="<?php 
        the_permalink();
        ?>
">
			<img src="<?php 
        echo $image['url'];
        ?>
" alt="<?php 
        the_title();
        ?>
" />
			<h4 class="hb-heading hb-center-heading alt-color-1"><span><?php 
    _e('Related Projects', 'hbthemes');
    ?>
</span></h4>
		</div>
	</div>

	<!-- BEGIN .related-portfolio-items -->
	<div class="row related-portfolio-items columns-4">
	<?php 
    while ($related_items->have_posts()) {
        $related_items->the_post();
        ?>
		<?php 
        $thumb = get_post_thumbnail_id();
        $image = hb_resize($thumb, '', 289, 216, true);
        if ($image) {
            ?>
			<!-- BEGIN .portfolio-related-item -->
			<div class="portfolio-related-item">
				<div class="standard-gallery-item">
					<div class="hb-gal-standard-img-wrapper">
						<a href="<?php 
            the_permalink();
            ?>
">
							<img src="<?php 
            echo $image['url'];
            ?>
">
							<div class="item-overlay"></div>
Exemple #10
0
                         $icon_to_use = 'hb-moon-quotes-right';
                     } else {
                         if ($format == 'link') {
                             $icon_to_use = 'hb-moon-link-5';
                         }
                     }
                 }
             }
         }
     }
     $thumb = get_post_thumbnail_id();
     $full_thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'original');
     echo '<article class="search-entry clearfix">';
     echo '<span class="search-result-counter ">' . $search_counter . '</span>';
     if ($thumb) {
         $image = hb_resize($thumb, '', 80, 80, true);
         echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="search-thumb"><img src="' . $image['url'] . '" alt="' . get_the_title() . '" /></a>';
     } else {
         echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="search-thumb"><i class="' . $icon_to_use . '"></i></a>';
     }
     $echo_title = get_the_title();
     if ($echo_title == "") {
         $echo_title = __('No Title', 'hbthemes');
     }
     echo '<h4 class="semi-bold"><a href="' . get_permalink() . '" title="' . $echo_title . '">' . $echo_title . '</a></h4>';
     echo '<div class="minor-meta">' . get_the_time('M j, Y') . '</div>';
     echo '<div class="excerpt-wrap">';
     the_excerpt();
     echo '</div>';
     echo '</article>';
 }
Exemple #11
0
function hb_testimonial_box($post_id)
{
    $testimonial_post = get_post($post_id);
    if ($testimonial_post) {
        setup_postdata($testimonial_post);
        ?>
	<div class="hb-testimonial">
		<?php 
        the_content();
        ?>
	</div>
						
	<?php 
        $author_image = vp_metabox('testimonial_type_settings.hb_testimonial_author_image');
        $author_name = vp_metabox('testimonial_type_settings.hb_testimonial_author');
        $author_desc = vp_metabox('testimonial_type_settings.hb_testimonial_description');
        $author_desc_link = vp_metabox('testimonial_type_settings.hb_testimonial_description_link');
        if ($author_image) {
            $author_image = hb_resize(null, $author_image, 60, 60, true);
            ?>
			<img src="<?php 
            echo $author_image['url'];
            ?>
" width="60" height="60" class="testimonial-author-img"/>
		<?php 
        }
        ?>

		<?php 
        if ($author_name || $author_desc) {
            ?>
			<div class="testimonial-author">
				<?php 
            if ($author_name) {
                ?>
					<h5 class="testimonial-author-name">
						<?php 
                echo $author_name;
                ?>
					</h5>
				<?php 
            }
            ?>

				<?php 
            if ($author_desc && $author_desc_link) {
                ?>
					<a href="<?php 
                echo $author_desc_link;
                ?>
" class="testimonial-company"><?php 
                echo $author_desc;
                ?>
</a>
				<?php 
            } else {
                if ($author_desc) {
                    ?>
					<a class="testimonial-company"><?php 
                    echo $author_desc;
                    ?>
</a>
				<?php 
                }
            }
            ?>
			</div>
		<?php 
        }
        wp_reset_postdata();
    }
}
    function widget($args, $instance)
    {
        extract($args);
        global $wp_query;
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $number = $instance['number'];
        $category = $instance['category'];
        $orderby = $instance['orderby'];
        $order = $instance['order'];
        $show_excerpt = !empty($instance['show_excerpt']) ? $instance['show_excerpt'] : false;
        $show_thumb = !empty($instance['show_thumb']) ? $instance['show_thumb'] : false;
        /* Before widget (defined by themes). */
        echo $before_widget;
        /* Display the widget title if one was input (before and after defined by themes). */
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if (!$number) {
            $number = -1;
        }
        $blog_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category__in' => $category, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => true));
        if ($blog_posts->have_posts()) {
            ?>
			<ul>
			<?php 
            while ($blog_posts->have_posts()) {
                $blog_posts->the_post();
                $excerpt = wp_trim_words(get_the_excerpt(), 10, '...<br/><a class="hb-focus-color" href="' . get_permalink() . '">' . __("Read More", "hbthemes") . '</a>');
                $thumb = get_post_thumbnail_id();
                $full_thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'original');
                $image_thumb = '';
                $simple_class = '';
                if (!$thumb && !$show_thumb || !$show_excerpt && !$show_thumb) {
                    $simple_class = ' simple';
                }
                if ($thumb && $show_thumb) {
                    $image = hb_resize($thumb, '', 80, 80, true);
                    $image_thumb = '<div class="hb-spl-thumb"><a href="' . get_the_permalink() . '"><img src="' . $image['url'] . '" alt="' . get_the_title() . '" /></a></div>';
                }
                ?>


					<li class="clearfix<?php 
                echo $simple_class;
                ?>
">
						
						<?php 
                echo $image_thumb;
                ?>
						<div class="hb-spl-inner">
							<a href="<?php 
                echo get_the_permalink();
                ?>
"><?php 
                echo get_the_title();
                ?>
</a>
							<?php 
                if ($show_excerpt) {
                    ?>
								<span class="hb-spl-excerpt"><?php 
                    echo $excerpt;
                    ?>
</span>
							<?php 
                }
                ?>
						</div>
					</li>
			<?php 
            }
            ?>
			</ul>
		<?php 
        }
        echo $after_widget;
    }
Exemple #13
0
	<?php 
do_action('woocommerce_before_subcategory', $category);
?>

	<a href="<?php 
echo get_term_link($category->slug, 'product_cat');
?>
">

		<?php 
$small_thumbnail_size = apply_filters('single_product_small_thumbnail_size', 'shop_catalog');
$dimensions = wc_get_image_size($small_thumbnail_size);
$thumbnail_id = get_woocommerce_term_meta($category->term_id, 'thumbnail_id', true);
if ($thumbnail_id) {
    $image = hb_resize($thumbnail_id, '', 526, 700, true);
} else {
    $image = wc_placeholder_img_src();
}
if ($image) {
    $image = str_replace(' ', '%20', $image);
    echo '<a href="' . get_term_link($category->slug, 'product_cat') . '" class="woo-category-wrap"><img src="' . esc_url($image["url"]) . '" alt="' . esc_attr($category->name) . '" width="' . esc_attr($image['width']) . '" height="' . esc_attr($image['height']) . '" />';
}
?>

		<div class="woo-cat-details">
		<h6 class="special">
			<?php 
echo $category->name;
?>
		</h6>
Exemple #14
0
function hb_team_member_box($post_id, $style = "", $excerpt_length = 20)
{
    $testimonial_post = get_post($post_id);
    if ($testimonial_post) {
        setup_postdata($testimonial_post);
        $thumb = get_post_thumbnail_id();
        if ($style != "") {
            $style = " tmb-2";
        }
        ?>

	<!-- BEGIN .team-member-box -->
	<div class="team-member-box<?php 
        echo $style;
        ?>
">
								
		<div class="team-member-img">
			<?php 
        if ($thumb) {
            $image = hb_resize($thumb, '', 350, 350, true);
            if ($image) {
                ?>
				<img src="<?php 
                echo $image['url'];
                ?>
" alt="<?php 
                the_title();
                ?>
"/>
			<?php 
            }
            ?>
				<ul class="social-icons dark">
			<?php 
            $social_links = array("envelop" => "Mail", "dribbble" => "Dribbble", "facebook" => "Facebook", "flickr" => "Flickr", "forrst" => "Forrst", "google-plus" => "Google Plus", "html5" => "HTML 5", "cloud" => "iCloud", "lastfm" => "LastFM", "linkedin" => "LinkedIn", "paypal" => "PayPal", "pinterest" => "Pinterest", "reddit" => "Reddit", "feed2" => "RSS", "skype" => "Skype", "stumbleupon" => "StumbleUpon", "tumblr" => "Tumblr", "twitter" => "Twitter", "vimeo" => "Vimeo", "wordpress" => "WordPress", "yahoo" => "Yahoo", "youtube" => "YouTube", "github" => "Github", "yelp" => "Yelp", "mail" => "Mail", "instagram" => "Instagram", "foursquare" => "Foursquare", "xing" => "Xing");
            foreach ($social_links as $soc_id => $soc_name) {
                if (vp_metabox('team_member_settings.hb_employee_social_' . $soc_id)) {
                    ?>
						<li class="<?php 
                    echo $soc_id;
                    ?>
"><a href="<?php 
                    echo vp_metabox('team_member_settings.hb_employee_social_' . $soc_id);
                    ?>
" target="_blank"><i class="hb-moon-<?php 
                    echo $soc_id;
                    ?>
"></i><i class="hb-moon-<?php 
                    echo $soc_id;
                    ?>
"></i></a></li>
						<?php 
                }
            }
            ?>
				</ul>
			<?php 
        }
        ?>

		</div>
									
		<!-- START .team-member-description -->
		<div class="team-member-description">
										
			<!-- START .team-header-info -->
			<div class="team-header-info clearfix">
											
				<!-- START .team-header-name -->
				<div class="team-name">
					<h4 class="team-member-name"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h4>
					<?php 
        if (vp_metabox('team_member_settings.hb_employee_position')) {
            ?>
					<p class="team-position"><?php 
            echo vp_metabox('team_member_settings.hb_employee_position');
            ?>
</p>
					<?php 
        }
        ?>
				</div>
				<!-- END .team-name -->
											
											
			</div>
			<!-- END .team-header-info -->

			<div class="spacer" style="height:10px;"></div>

			<!-- START .team-member-content -->
			<div class="team-member-content">
				<?php 
        if (has_excerpt()) {
            echo '<p class="nbm">' . get_the_excerpt() . '</p>';
            ?>
 <div class="spacer" style="height:15px;"></div> <?php 
        } else {
            ?>
				<div class="spacer" style="height:15px;"></div>
				<p class="nbm"><?php 
            echo wp_trim_words(strip_shortcodes(get_the_content()), $excerpt_length, NULL);
            ?>
</p>
				<?php 
        }
        ?>
			</div>
		

			<!-- END .team-member-content -->
			<a class="simple-read-more" href="<?php 
        the_permalink();
        ?>
" target="_self"><?php 
        _e('View Profile', 'hbthemes');
        ?>
</a>
										
		</div>
		<!-- END .team-member-description -->
		
	</div>
	<!-- END .team-member-box -->

	<?php 
        wp_reset_postdata();
    }
}
 function widget($args, $instance)
 {
     extract($args);
     global $wp_query;
     /* Our variables from the widget settings. */
     $title = apply_filters('widget_title', $instance['title']);
     $number = $instance['number'];
     $category = $instance['category'];
     $column_class = 'columns-3';
     /* Before widget (defined by themes). */
     echo $before_widget;
     /* Display the widget title if one was input (before and after defined by themes). */
     if ($title) {
         echo $before_title . $title . $after_title;
     }
     if (!$number) {
         $number = -1;
     }
     $unique_id = "unique_id_" . rand(1, 50000);
     if ($category) {
         $portfolio_items = new WP_Query(array('post_type' => 'portfolio', 'meta_key' => '_likes', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'posts_per_page' => $number, 'tax_query' => array(array('taxonomy' => 'portfolio_categories', 'field' => 'id', 'terms' => $category))));
     } else {
         $portfolio_items = new WP_Query(array('post_type' => 'portfolio', 'meta_key' => '_likes', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'posts_per_page' => $number));
     }
     if (!$number) {
         $number = 1;
     }
     if ($number == 1) {
         $column_class = 'columns-1';
     }
     if ($number == 2) {
         $column_class = 'columns-2';
     }
     if ($number == 3 || $number == 6 || $number == 9 || $number == 15 || $number == 18) {
         $column_class = 'columns-3';
     }
     if ($number == 4 || $number == 8 || $number == 12 || $number == 16 || $number == 24) {
         $column_class = 'columns-4';
     }
     echo '<div class="hb-stream ' . $column_class . ' clearfix" id="' . $unique_id . '"><ul>';
     $counter = (int) $number;
     if ($portfolio_items->have_posts()) {
         while ($portfolio_items->have_posts()) {
             $portfolio_items->the_post();
             $perma = get_the_permalink();
             $custom_url = vp_metabox('portfolio_settings.hb_portfolio_custom_url');
             if ($custom_url) {
                 $perma = $custom_url;
             }
             $thumb = get_post_thumbnail_id();
             $image = hb_resize($thumb, '', 250, 250, true);
             $likes = hb_like_this(get_the_ID());
             if ($thumb) {
                 $counter--;
                 if ($counter >= 0) {
                     echo '<li><a href="' . $perma . '" title="' . get_the_title() . '" rel="tooltip">';
                     echo '<img src="' . $image['url'] . '" />';
                     echo '<span class="widget-like-count"><i class="hb-moon-heart"></i>' . number_format($likes) . '</span>';
                     echo '</a></li>';
                 }
             }
         }
     }
     wp_reset_query();
     echo '</ul></div>';
     echo $after_widget;
 }
Exemple #16
0
    function widget($args, $instance)
    {
        extract($args);
        global $wp_query;
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $number = $instance['number'];
        $category = $instance['category'];
        /* Before widget (defined by themes). */
        echo $before_widget;
        /* Display the widget title if one was input (before and after defined by themes). */
        if ($title) {
            echo $before_title . $title . $after_title;
        }
        if (!$number) {
            $number = -1;
        }
        $blog_posts = new WP_Query(array('post_type' => 'post', 'posts_per_page' => $number, 'category__in' => $category, 'orderby' => 'date', 'order' => 'DESC', 'ignore_sticky_posts' => true));
        if ($blog_posts->have_posts()) {
            ?>
			<?php 
            while ($blog_posts->have_posts()) {
                $blog_posts->the_post();
                $format = get_post_format(get_the_ID());
                $icon_to_use = 'hb-moon-file-3';
                if ($format == 'video') {
                    $icon_to_use = 'hb-moon-play-2';
                } else {
                    if ($format == 'status' || $format == 'standard') {
                        $icon_to_use = 'hb-moon-pencil';
                    } else {
                        if ($format == 'gallery' || $format == 'image') {
                            $icon_to_use = 'hb-moon-image-3';
                        } else {
                            if ($format == 'audio') {
                                $icon_to_use = 'hb-moon-music-2';
                            } else {
                                if ($format == 'quote') {
                                    $icon_to_use = 'hb-moon-quotes-right';
                                } else {
                                    if ($format == 'link') {
                                        $icon_to_use = 'hb-moon-link-5';
                                    }
                                }
                            }
                        }
                    }
                }
                $thumb = get_post_thumbnail_id();
                $full_thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'original');
                echo '<article class="search-entry clearfix">';
                if ($thumb) {
                    $image = hb_resize($thumb, '', 80, 80, true);
                    echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="search-thumb"><img src="' . $image['url'] . '" alt="' . get_the_title() . '" /></a>';
                } else {
                    echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '" class="search-thumb"><i class="' . $icon_to_use . '"></i></a>';
                }
                $echo_title = get_the_title();
                if ($echo_title == "") {
                    $echo_title = __('No Title', 'hbthemes');
                }
                echo '<h4 class="semi-bold"><a href="' . get_permalink() . '" title="' . $echo_title . '">' . $echo_title . '</a></h4>';
                echo '<div class="minor-meta">' . get_the_date() . '</div>';
                if (has_excerpt()) {
                    echo '<p class="nbm">' . get_the_excerpt() . '</p>';
                } else {
                    echo '<p class="nbm">' . hb_get_excerpt(get_the_excerpt(), 60) . '</p>';
                }
                echo '</article>';
            }
            ?>
		<?php 
        }
        echo $after_widget;
    }
Exemple #17
0
}
?>
 itemscope="itemscope" itemtype="http://schema.org/BlogPosting" itemprop="blogPost">
<?php 
if (!empty($gallery_images)) {
    ?>
<!-- BEGIN .featured-image -->
<div class="featured-image">
	<div class="hb-flexslider clearfix" id="flexslider_<?php 
    the_ID();
    ?>
">
		<ul class="hb-flex-slides clearfix">
			<?php 
    foreach ($gallery_images as $id => $gallery_image) {
        $image = hb_resize($id, '', 900, 500, true);
        $api_images .= "'" . addslashes($gallery_image['url']) . "',";
        $api_titles .= "'" . addslashes($gallery_image['title']) . "',";
        $api_descriptions .= "'" . addslashes($gallery_image['description']) . "',";
        ?>
			<li><a href="#" class="prettyphoto"><img alt="<?php 
        echo $gallery_image['title'];
        ?>
" src="<?php 
        echo $image['url'];
        ?>
" /></a></li>
			<?php 
    }
    $api_images = trim($api_images, ",");
    $api_titles = trim($api_titles, ",");
Exemple #18
0
function hb_slider_item_shortcode($params = array(), $content = null)
{
    extract(shortcode_atts(array('img' => '', 'title' => '', 'rel' => ''), $params));
    if ($rel != "") {
        $rel = ' rel="' . $rel . '"';
    } else {
        $rel = ' rel="prettyPhoto&#91;' . rand(1, 100000) . '&#93;"';
    }
    $image = hb_resize(null, $img, 900, 565, true);
    if ($image) {
        return '<li><a href="' . $img . '"' . $rel . ' data-title="' . $title . '" alt="Slider Image"><img src="' . $image['url'] . '"/></a></li>';
    }
}
				<?php 
        if (have_posts()) {
            ?>
				<!-- BEGIN #standard-gallery-masonry -->
				<div id="standard-gallery-masonry" class="clearfix">

				<?php 
            while (have_posts()) {
                the_post();
                $filters = wp_get_post_terms(get_the_ID(), 'portfolio_categories', array("fields" => "slugs"));
                $filters_string = implode($filters, " ");
                $filters_names = wp_get_post_terms(get_the_ID(), 'portfolio_categories', array("fields" => "names"));
                $filters_names_string = implode($filters_names, ", ");
                $thumb = get_post_thumbnail_id();
                $image = hb_resize($thumb, '', $image_dimensions['width'], $image_dimensions['height'], true);
                $perma = get_the_permalink();
                $custom_url = vp_metabox('portfolio_settings.hb_portfolio_custom_url');
                if ($custom_url) {
                    $perma = $custom_url;
                }
                ?>

					<!-- BEGIN .standard-gallery-item-wrap -->
					<div class="col-<?php 
                echo 12 / $portfolio_columns_count;
                ?>
 standard-gallery-item-wrap <?php 
                echo $filters_string;
                ?>
">
Exemple #20
0
if (get_the_post_thumbnail()) {
    $image_object = get_post_thumbnail_id();
    $image_title = esc_attr(get_the_title(get_post_thumbnail_id()));
    $image_link = wp_get_attachment_url(get_post_thumbnail_id());
    $shop_catalog = wc_get_image_size('shop_catalog');
    $image = hb_resize($image_object, '', $shop_catalog['width'], $shop_catalog['height'], true);
    echo '<div class="woo-category-wrap"><img src="' . $image["url"] . '" width="' . $image["width"] . '" height="' . $image["height"] . '"></div>';
} else {
    echo '<img src="' . woocommerce_placeholder_img_src() . '" alt="Placeholder" width="526" height="700" />';
}
$product_gallery = get_post_meta($post->ID, '_product_image_gallery', true);
if (!empty($product_gallery)) {
    $shop_catalog = wc_get_image_size('shop_catalog');
    $gallery = explode(',', $product_gallery);
    $image_id = $gallery[0];
    $image_src_hover = hb_resize($image_id, '', $shop_catalog['width'], $shop_catalog['height'], true);
    echo '<img src="' . $image_src_hover['url'] . '" alt="' . get_the_title() . '" class="product-hover-image" title="' . get_the_title() . '">';
}
$postdate = get_the_time('Y-m-d');
// Post date
$postdatestamp = strtotime($postdate);
// Timestamped post date
$newness = 3;
// Newness in days
if ($product->sale_price) {
    // Sale will be added through action hook
} else {
    if (hb_is_out_of_stock()) {
        echo '<span class="out-of-stock-badge">' . __('Sold out', 'hbthemes') . '</span>';
    } else {
        if (time() - 60 * 60 * 24 * $newness < $postdatestamp) {