?>
      	<?php 
    while ($loop_slider->have_posts()) {
        $loop_slider->the_post();
        ?>
        	<li class="slide"> 
        		<?php 
        wpsm_thumb('feature_slider');
        ?>
 <span class="pattern"></span>
          		<div class="flex-overlay">
            		<div class="post-meta">
              			<div class="inner_meta"><?php 
        $category = get_the_category(get_the_ID());
        $first_cat = $category[0]->term_id;
        meta_small(true, $first_cat, false);
        ?>
</div>
            		</div>
            		<h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
            		<?php 
        if (rehub_option('rehub_readmore_text') != '') {
            ?>
			  			<a href="<?php 
            the_permalink();
Exemple #2
0
    function rehub_create_column($size = 'middle')
    {
        ?>
<article class="rething_item small_post inf_scr_item">
    <?php 
        if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
            ?>
        <figure>
            <?php 
            rehub_formats_icons('full');
            ?>
            <span class="pattern"></span>
            <?php 
            echo getPostLikeLink(get_the_ID());
            ?>
            <?php 
            rehub_permalink();
            ?>
                <?php 
            $img = get_post_thumb();
            $nothumb = get_stylesheet_directory_uri() . '/images/noim.png';
            if ($size == 'middle') {
                $params = array('width' => 381, 'height' => 255, 'crop' => true);
            } elseif ($size == 'small') {
                $params = array('width' => 280, 'height' => 186, 'crop' => true);
            } elseif ($size == 'big') {
                $params = array('width' => 579, 'height' => 386, 'crop' => true);
            } else {
                $params = array('width' => 381, 'height' => 255, 'crop' => true);
            }
            ?>
				<?php 
            if (!empty($img)) {
                ?>
                	<img src="<?php 
                echo bfi_thumb($img, $params);
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
                <?php 
            } else {
                ?>
    
                    <img src="<?php 
                echo $nothumb;
                ?>
" alt="<?php 
                the_title_attribute();
                ?>
" />
                <?php 
            }
            ?>
            </a>
        </figure>                                     
    <?php 
        }
        ?>
    <div class="wrap_thing">
        <div class="top">
            <?php 
        $category = get_the_category(get_the_ID());
        ?>
            <?php 
        if ($category) {
            $first_cat = $category[0]->term_id;
            meta_small(false, $first_cat, false, false);
        }
        ?>
        </div>
        <div class="hover_anons">
            <h2><?php 
        rehub_permalink();
        the_title();
        ?>
</a></h2>
            <div class="post-meta"> <?php 
        meta_small(true, false, true, false);
        ?>
 </div>
            <?php 
        rehub_format_score('small');
        ?>
            <p><?php 
        kama_excerpt('maxchar=320');
        ?>
</p>
        </div>
        <?php 
        rehub_create_btn('yes');
        ?>
    </div>
</article>

<?php 
    }
            ?>
</a>
                <h5><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h5>
                <div class="rcnt_meta">
                    <p><?php 
            if ($module_cat == '') {
                $category = get_the_category($post->ID);
                $module_cat = $category[0]->term_id;
            }
            meta_small(false, $module_cat, true);
            ?>
</p>
                </div>
            </li>
        <?php 
        }
    }
    wp_reset_query();
    ?>
    </ul>
</section>
<div class="carousel-prev"></div>
<div class="carousel-next"></div>
</div>
<?php 
    /**
     * How to display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        if (is_singular('post')) {
            /* Our variables from the widget settings. */
            $title = apply_filters('widget_title', $instance['title']);
            $number = $instance['number'];
            global $post;
            $category = get_the_category($post->ID);
            $first_cat = $category[0]->term_id;
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $first_cat, 'meta_key' => 'rehub_review_overall_score', 'orderby' => 'meta_value_num', 'post__not_in' => array($post->ID), 'meta_query' => array(array('key' => 'rehub_framework_post_type', 'value' => 'review', 'compare' => 'LIKE')));
            $loop = new WP_Query($query);
            /* Before widget (defined by themes). */
            echo $before_widget;
            if ($loop->have_posts()) {
                /* Display the widget title if one was input (before and after defined by themes). */
                if ($title) {
                    echo $before_title . $title . $after_title;
                }
                ?>
		<div class="tabs-item clearfix">
		<?php 
                while ($loop->have_posts()) {
                    $loop->the_post();
                    ?>
	
			<div class="clearfix">
	            <figure><?php 
                    wpsm_thumb('med_thumbs');
                    ?>
 <?php 
                    rehub_formats_icons();
                    ?>
</figure>
	            <div class="detail">
		            <h5><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h5>
	            	<div class="rcnt_meta">
	                	<?php 
                    meta_small(false, false, true);
                    ?>
	                </div>
		            <?php 
                    rehub_format_score('small');
                    ?>
	            </div>
            </div>	
		<?php 
                }
                ?>
		</div>
		<?php 
                wp_reset_query();
                ?>
		<?php 
            } else {
                ?>
		<?php 
            }
            ?>
	
	<?php 
            /* After widget (defined by themes). */
            echo $after_widget;
        }
    }
Exemple #5
0
        if (vp_metabox('rehub_post_side.disable_top_offer') != '1') {
            rehub_create_top_btn('');
        }
        ?>
                        <div>                            
                            <h1 itemprop="name"><?php 
        the_title();
        ?>
</h1>
                        </div>                                
                        <div class="meta post-meta">
                            <?php 
        if ($category) {
            meta_small(true, $first_cat, true, false);
        } else {
            meta_small(true, false, true, false);
        }
        ?>
                            
                        </div>
                        <meta itemprop="datePublished" content="<?php 
        the_time('Y-m-d');
        ?>
">
                    </div> 
                    <?php 
        echo getHotLike(get_the_ID());
        ?>
                                   	
                    <?php 
        if (vp_metabox('rehub_post.rehub_framework_post_type') == 'review' && vp_metabox('rehub_post.review_post.0.review_post_schema_type') == 'review_woo_product' && vp_metabox('rehub_post.review_post.0.review_woo_product.0.review_woo_slider') == '1') {
		<?php 
if (has_post_thumbnail()) {
    $img = get_post_thumb();
    $params = array('width' => 60, 'height' => 60, 'crop' => true);
    echo '<img src="' . bfi_thumb($img, $params) . '" alt="' . the_title_attribute(array("echo" => 0)) . '" width="60" height="60" />';
} else {
    $nothumb = get_template_directory_uri() . '/images/noim.png';
    echo '<img src="' . $nothumb . '" alt="' . the_title_attribute(array("echo" => 0)) . '" width="60" height="60" />';
}
?>
	</div>
	<div class="multi_cat_info">		
		<div class="multi_cat_title"><a href="<?php 
the_permalink();
?>
" ><?php 
the_title();
?>
</a></div>
	    <div class="rcnt_meta">
	  		<?php 
$category = get_the_category($post->ID);
$first_cat = $category[0]->term_id;
?>
	    	<?php 
meta_small(false, $first_cat, true, false);
?>
	    </div>
	</div>
</div>
Exemple #7
0
    function rehub_most_popular_widget_block($basedby = 'hot', $sortby = '', $number = 5)
    {
        ?>

	<?php 
        if ($sortby == 'this_week') {
            if (!function_exists('filter_where_week')) {
                function filter_where_week($where = '')
                {
                    //posts in the last 7 days
                    $where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
                    return $where;
                }
            }
            add_filter('posts_where', 'filter_where_week');
        } elseif ($sortby == 'this_month') {
            if (!function_exists('filter_where_month')) {
                function filter_where_month($where = '')
                {
                    //posts in the last 30 days
                    $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
                    return $where;
                }
            }
            add_filter('posts_where', 'filter_where_month');
        } elseif ($sortby == 'three_month') {
            if (!function_exists('filter_where_t_month')) {
                function filter_where_t_month($where = '')
                {
                    //posts in the last 30 days
                    $where .= " AND post_date > '" . date('Y-m-d', strtotime('-90 days')) . "'";
                    return $where;
                }
            }
            add_filter('posts_where', 'filter_where_t_month');
        } else {
        }
        global $post;
        if ($basedby == 'hot') {
            $popular_posts = new WP_Query('showposts=' . $number . '&meta_key=post_hot_count&orderby=meta_value_num&order=DESC&ignore_sticky_posts=1');
        } elseif ($basedby == 'views') {
            $popular_posts = new WP_Query('showposts=' . $number . '&meta_key=rehub_views&orderby=meta_value_num&order=DESC&ignore_sticky_posts=1');
        } else {
            $popular_posts = new WP_Query('showposts=' . $number . '&orderby=comment_count&order=DESC&ignore_sticky_posts=1');
        }
        if ($popular_posts->have_posts()) {
            ?>
	
	
		<?php 
            while ($popular_posts->have_posts()) {
                $popular_posts->the_post();
                ?>
			<div class="clearfix">
	            <figure><a href="<?php 
                the_permalink();
                ?>
"><?php 
                wpsm_thumb('med_thumbs');
                ?>
</a></figure>
	            <div class="detail">
		            <h5><?php 
                if ($basedby == 'hot') {
                    echo getHotLikeTitle(get_the_ID());
                }
                ?>
<a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
	            	<div class="rcnt_meta">
	              		<?php 
                $category = get_the_category($post->ID);
                $first_cat = $category[0]->term_id;
                ?>
	                	<?php 
                if ($basedby == 'views') {
                    meta_small(false, $first_cat, false, true);
                } else {
                    meta_small(false, $first_cat, true, false);
                }
                ?>
	                </div>
					<?php 
                $quick_price = get_post_meta(get_the_ID(), 'rehub_offer_product_price', true);
                $egg_price = get_post_meta(get_the_ID(), 'affegg_product_price', true);
                if (!empty($quick_price)) {
                    echo '<span class="price_count">' . $quick_price . '</span>';
                } elseif (!empty($egg_price)) {
                    $re_egg_currency = get_post_meta(get_the_ID(), 'affegg_product_currency', true);
                    $types = array("RUB" => "руб.", "UAH" => "грн.", "USD" => "\$", "CAD" => "\$", "GBP" => "&pound;", "EUR" => "&euro;", "JPY" => "&yen;", "CNY" => "&yen;", "INR" => "&#8377;");
                    if (key_exists($re_egg_currency, $types)) {
                        $re_egg_currency = $types[$re_egg_currency];
                    }
                    echo '<span class="price_count">' . $re_egg_currency . $egg_price . '</span>';
                }
                ?>
	            </div>
            </div>
		
		<?php 
            }
            ?>
		<?php 
            wp_reset_query();
            ?>
		<?php 
        }
        remove_filter('posts_where', 'filter_where_month');
        remove_filter('posts_where', 'filter_where_t_month');
        remove_filter('posts_where', 'filter_where_week');
        ?>


<?php 
    }
} else {
    ?>
				<?php 
    $post_slider = new WP_Query(array('cat' => $module_cats, 'post_type' => 'post', 'showposts' => $module_fetch, 'post__not_in' => $exclude_posts, 'ignore_sticky_posts' => 1));
    if ($post_slider->have_posts()) {
        while ($post_slider->have_posts()) {
            $post_slider->the_post();
            ?>
		          <li class="slide"> <?php 
            wpsm_thumb('feature_slider');
            ?>
 <span class="pattern"></span>
		            <div class="flex-overlay">
		              <div class="post-meta">
		                <div class="inner_meta"><?php 
            meta_small(true, $module_cats, false);
            ?>
</div>
		              </div>
		              <h2><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title();
            ?>
</a></h2>
	            		<?php 
            if (rehub_option('rehub_readmore_text') != '') {
                ?>
				  			<a href="<?php 
                the_permalink();
    function rehub_top_offers_widget_block_post($tags = '', $number = '5', $order = '')
    {
        ?>

	<?php 
        $args = array('showposts' => $number, 'tag' => $tags, 'ignore_sticky_posts' => '1');
        if (!empty($order)) {
            $args['meta_key'] = $order;
            $args['orderby'] = 'meta_value_num';
            $args['order'] = 'DESC';
        }
        $offers = new WP_Query($args);
        if ($offers->have_posts()) {
            ?>
	
	<div class="tabs-item">
		<?php 
            while ($offers->have_posts()) {
                $offers->the_post();
                ?>
		
			<div class="clearfix">
	            <figure><a href="<?php 
                the_permalink();
                ?>
"><?php 
                wpsm_thumb('med_thumbs');
                ?>
</a></figure>
	            <div class="detail">
		            <h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
	            	<div class="rcnt_meta">
	              		<?php 
                $category = get_the_category(get_the_ID());
                $first_cat = $category[0]->term_id;
                ?>
	                	<?php 
                meta_small(false, $first_cat, true, false);
                ?>
	                </div>
	                <?php 
                rehub_format_score('small');
                ?>

	            </div>
            </div>
		
		<?php 
            }
            ?>
		<?php 
            wp_reset_query();
            ?>
		<?php 
        }
        ?>
	</div>

<?php 
    }
Exemple #10
0
    /**
     * How to display the widget on the screen.
     */
    function widget($args, $instance)
    {
        extract($args);
        /* Our variables from the widget settings. */
        $title = apply_filters('widget_title', $instance['title']);
        $categories = $instance['categories'];
        $sortby = $instance['sortby'];
        $number = $instance['number'];
        $post_type = $instance['post_type'];
        if (!empty($instance['dark'])) {
            $color = 'dark';
        } else {
            $color = '';
        }
        if ($sortby == 'this_week') {
            function filter_where($where = '')
            {
                //posts in the last 7 days
                $where .= " AND post_date > '" . date('Y-m-d', strtotime('-7 days')) . "'";
                return $where;
            }
            add_filter('posts_where', 'filter_where');
        } elseif ($sortby == 'this_month') {
            function filter_where($where = '')
            {
                //posts in the last 30 days
                $where .= " AND post_date > '" . date('Y-m-d', strtotime('-30 days')) . "'";
                return $where;
            }
            add_filter('posts_where', 'filter_where');
        } elseif ($sortby == 'three_month') {
            function filter_where($where = '')
            {
                //posts in the last 30 days
                $where .= " AND post_date > '" . date('Y-m-d', strtotime('-90 days')) . "'";
                return $where;
            }
            add_filter('posts_where', 'filter_where');
        }
        if ($post_type == 'all') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories);
        } elseif ($post_type == 'regular') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'regular');
        } elseif ($post_type == 'video') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'video');
        } elseif ($post_type == 'gallery') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'gallery');
        } elseif ($post_type == 'review') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'review');
        } elseif ($post_type == 'music') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories, 'meta_key' => 'rehub_framework_post_type', 'meta_value' => 'music');
        } else {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'cat' => $categories);
        }
        if ($sortby == 'random') {
            $query['orderby'] = 'rand';
        }
        global $post;
        $loop = new WP_Query($query);
        /* Before widget (defined by themes). */
        echo $before_widget;
        if ($loop->have_posts()) {
            /* Display the widget title if one was input (before and after defined by themes). */
            if ($title) {
                echo $before_title . $title . $after_title;
            }
            ?>
	<div class="color_sidebar<?php 
            if ($color == 'dark') {
                ?>
 dark_sidebar<?php 
            }
            ?>
">
		<div class="tabs-item clearfix">
		<?php 
            while ($loop->have_posts()) {
                $loop->the_post();
                ?>
	
			<div class="clearfix">
	            <figure><a href="<?php 
                the_permalink();
                ?>
"><?php 
                wpsm_thumb('med_thumbs');
                ?>
</a></figure>
	            <div class="detail">
		            <h5><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h5>
	            	<div class="rcnt_meta">
	              		<?php 
                $category = get_the_category($post->ID);
                $first_cat = $category[0]->term_id;
                ?>
	                	<?php 
                meta_small(false, $first_cat, true);
                ?>
	                </div>
		            <?php 
                rehub_format_score('small');
                ?>
	            </div>
            </div>	
		<?php 
            }
            ?>
		</div>
	</div>	
	<?php 
            wp_reset_query();
            ?>
	<?php 
        } else {
            _e('No posts for this criteria.', 'rehub_framework');
            ?>
	<?php 
        }
        ?>
	<?php 
        remove_filter('posts_where', 'filter_where');
        ?>
		
	<?php 
        /* After widget (defined by themes). */
        echo $after_widget;
    }