示例#1
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']);
        $tags = $instance['tags'];
        $number = $instance['number'];
        $post_type = $instance['post_type'];
        global $post;
        if ($post_type == 'tags') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'tag' => $tags);
        } elseif ($post_type == 'featured') {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'is_featured', 'meta_value' => '1');
        } else {
            $query = array('showposts' => $number, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'is_featured', 'meta_value' => '1');
        }
        $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;
            }
            ?>
		<?php 
            wp_enqueue_script('flexslider');
            ?>
		<div class="slides">		
		<?php 
            while ($loop->have_posts()) {
                $loop->the_post();
                ?>
	
			<div class="slide">
				<div class="wrap">
					<a href="<?php 
                the_permalink();
                ?>
" class="view-link">
						<span class="pattern"></span>
						<div class="image"><?php 
                wpsm_thumb('grid_news');
                ?>
</div>
						<?php 
                if (vp_metabox('rehub_post.rehub_framework_post_type') == 'review') {
                    ?>
<span class="score"><i><?php 
                    echo rehub_get_overall_score();
                    ?>
</i><?php 
                    _e('SCORE', 'rehub_framework');
                    ?>
</span><?php 
                }
                ?>
						<?php 
                $category = get_the_category($post->ID);
                $first_cat = $category[0]->term_id;
                $cat_name = get_cat_name($first_cat);
                ?>
						<span class="reviews"><?php 
                echo $cat_name;
                ?>
</span>
					</a>
					<h3><a class="link" href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h3>
					<p><?php 
                kama_excerpt('maxchar=100');
                ?>
</p>
				</div>
            </div>	
		<?php 
            }
            ?>
		</div>
		<?php 
            wp_reset_query();
            ?>
		<?php 
        } else {
            _e('No posts for this criteria.', 'rehub_framework');
            ?>
		<?php 
        }
        ?>
			
	<?php 
        /* After widget (defined by themes). */
        echo $after_widget;
    }
示例#2
0
$category = get_the_category();
if ($category) {
    $first_cat = $category[0]->term_id;
}
?>
	    <div class="post-meta"> <?php 
if ($category) {
    meta_all(true, $first_cat, true);
}
?>
 </div>
	    <?php 
rehub_format_score('small');
?>
	    <p><?php 
kama_excerpt('maxchar=180');
?>
</p>
        <?php 
if (vp_metabox('rehub_post_side.disable_top_offer') != '1') {
    ?>
            <?php 
    rehub_create_btn('yes');
    ?>
        <?php 
} else {
    ?>
            <?php 
    if (vp_metabox('rehub_post_side.read_more_custom')) {
        ?>
                <a href="<?php 
示例#3
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 
    }
示例#4
0
    function rehub_get_woo_list($data_source = '', $type = '', $cat = '', $tag = '', $ids = '', $orderby = '', $order = '', $show = '', $show_coupons_only = '')
    {
        ?>

<?php 
        if ($data_source == 'ids' && $ids != '') {
            $ids = explode(',', $ids);
            $args = array('post__in' => $ids, 'numberposts' => '-1', 'orderby' => 'post__in', 'post_type' => 'product', 'ignore_sticky_posts' => 1);
        } else {
            $args = array('post_type' => 'product', 'posts_per_page' => $show, 'orderby' => $orderby, 'order' => $order, 'ignore_sticky_posts' => 1);
            if ($data_source == 'cat' && $cat != '') {
                $cat = explode(',', $cat);
                $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'terms' => $cat, 'field' => 'id'));
            }
            if ($data_source == 'tag' && $tag != '') {
                $tag = explode(',', $tag);
                $args['tax_query'] = array(array('taxonomy' => 'product_tag', 'terms' => $tag, 'field' => 'id'));
            }
            if ($data_source == 'type') {
                if ($type == 'featured') {
                    $args['meta_query'] = array(array('key' => '_featured', 'value' => 'yes'));
                } elseif ($type == 'sale') {
                    $product_ids_on_sale = wc_get_product_ids_on_sale();
                    $meta_query = array();
                    $meta_query[] = WC()->query->visibility_meta_query();
                    $meta_query[] = WC()->query->stock_status_meta_query();
                    $meta_query = array_filter($meta_query);
                    $args['meta_query'] = $meta_query;
                    $args['post__in'] = array_merge(array(0), $product_ids_on_sale);
                    $args['no_found_rows'] = 1;
                } elseif ($type == 'best_sale') {
                    $args['meta_key'] = 'total_sales';
                    $args['orderby'] = 'meta_value_num';
                }
            }
        }
        if ($show_coupons_only == '1') {
            $args['meta_query'][] = array('key' => 'rehub_woo_coupon_date', 'value' => date('Y-m-d'), 'compare' => '>=');
        }
        global $post;
        global $woocommerce;
        $backup = $post;
        $result_min = array();
        //add array of prices
        ?>
<div class="aff_offer_links">
<?php 
        $i = 1;
        $wp_query = new WP_Query($args);
        if ($wp_query->have_posts()) {
            while ($wp_query->have_posts()) {
                $wp_query->the_post();
                global $product;
                ?>

<?php 
                $woolink = $product->product_type == 'external' ? $product->add_to_cart_url() : get_post_permalink(get_the_ID());
                $term_ids = wp_get_post_terms(get_the_ID(), 'product_tag', array("fields" => "ids"));
                if (!empty($term_ids)) {
                    $term_brand = $term_ids[0];
                    $term_brand_image = get_option("taxonomy_term_{$term_ids['0']}");
                } else {
                    $term_brand_image = '';
                }
                ?>
<div class="rehub_feat_block table_view_block"><a name="woo-link-list"></a>
    <?php 
                if ($product->is_on_sale()) {
                    ?>
<div class="vip_corner"><span class="vip_badge sale_badge">Sale!</span></div><?php 
                }
                ?>
    <div class="block_with_coupon">
        <div class="offer_thumb">
        <a href="<?php 
                echo $woolink;
                ?>
" target="_blank"<?php 
                if ($product->product_type == 'external') {
                    echo ' rel="nofollow"';
                }
                ?>
><?php 
                wpsm_thumb('med_thumbs');
                ?>
</a>
        </div>
        <div class="desc_col">
            <div class="offer_title"><a href="<?php 
                echo $woolink;
                ?>
" target="_blank"<?php 
                if ($product->product_type == 'external') {
                    echo ' rel="nofollow"';
                }
                ?>
><?php 
                the_title();
                ?>
</a></div>
            <p>
            	<?php 
                kama_excerpt('maxchar=150');
                ?>
            	<?php 
                $rehub_woo_review_related = get_post_meta(get_the_ID(), "review_woo_id", true);
                if (!empty($rehub_woo_review_related)) {
                    ?>
                	<a href="<?php 
                    echo get_permalink($rehub_woo_review_related);
                    ?>
" target="_blank" class="color_link"><?php 
                    _e("Read review", "rehub_framework");
                    ?>
</a>
                	<div class="clearfix"></div>
            	<?php 
                }
                ?>
            </p>
            <p>
                <?php 
                if (in_array('yith-woocommerce-compare/init.php', apply_filters('active_plugins', get_option('active_plugins')))) {
                    ?>
                    <?php 
                    echo do_shortcode('[yith_compare_button]');
                    ?>
                <?php 
                }
                ?>
                <?php 
                if (in_array('yith-woocommerce-wishlist/init.php', apply_filters('active_plugins', get_option('active_plugins')))) {
                    ?>
                    <?php 
                    echo do_shortcode('[yith_wcwl_add_to_wishlist]');
                    ?>
                <?php 
                }
                ?>
            </p>
        </div>
            <div class="price_col">
                <?php 
                if ($product->get_price() != '') {
                    ?>
                <p><span class="price_count"><?php 
                    echo $product->get_price_html();
                    ?>
</span></p>
                <?php 
                    $price_clean = preg_replace("/[^0-9.]/", "", $product->get_price());
                    $result_min[] = $price_clean;
                    ?>
                <?php 
                }
                ?>
                <?php 
                if (!empty($term_brand_image['brand_image'])) {
                    ?>
                <div class="aff_tag">
                    <img src="<?php 
                    $params = array('width' => 120, 'height' => 90);
                    echo bfi_thumb($term_brand_image['brand_image'], $params);
                    ?>
" alt="<?php 
                    the_title_attribute();
                    ?>
" />
                </div>
                <?php 
                }
                ?>
            </div>
            <div class="buttons_col">
                <div class="priced_block">
                    <?php 
                if ($product->is_in_stock() && $product->add_to_cart_url() != '') {
                    ?>
                        <?php 
                    echo apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" data-product_id="%s" data-product_sku="%s" class="btn_offer_block %s product_type_%s"%s%s>%s</a>', esc_url($product->add_to_cart_url()), esc_attr($product->id), esc_attr($product->get_sku()), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : 'add_to_cart_button', esc_attr($product->product_type), $product->product_type == 'external' ? ' target="_blank"' : '', $product->product_type == 'external' ? ' rel="nofollow"' : '', esc_html($product->add_to_cart_text())), $product);
                    ?>
                    <?php 
                }
                ?>
                </div>
                <?php 
                $offer_coupon = get_post_meta(get_the_ID(), 'rehub_woo_coupon_code', true);
                ?>
                <?php 
                $offer_coupon_date = get_post_meta(get_the_ID(), 'rehub_woo_coupon_date', true);
                ?>
                <?php 
                $offer_coupon_mask = get_post_meta(get_the_ID(), 'rehub_woo_coupon_mask', true);
                ?>
                <?php 
                $offer_coupon_url = esc_url($product->add_to_cart_url());
                ?>
                <?php 
                if (!empty($offer_coupon_date)) {
                    ?>
                    <?php 
                    $timestamp1 = strtotime($offer_coupon_date);
                    $seconds = $timestamp1 - time();
                    $days = floor($seconds / 86400);
                    $seconds %= 86400;
                    if ($days > 0) {
                        $coupon_text = $days . ' ' . __('days left', 'rehub_framework');
                        $coupon_style = '';
                    } elseif ($days == 0) {
                        $coupon_text = __('Last day', 'rehub_framework');
                        $coupon_style = '';
                    } else {
                        $coupon_text = __('Coupon is Expired', 'rehub_framework');
                        $coupon_style = 'expired_coupon';
                    }
                    ?>
                <?php 
                }
                ?>
                <?php 
                if (!empty($offer_coupon)) {
                    ?>
                    <?php 
                    wp_enqueue_script('zeroclipboard');
                    ?>
                    <?php 
                    if ($offer_coupon_mask != '1' && $offer_coupon_mask != 'on') {
                        ?>
                      <div class="rehub_offer_coupon not_masked_coupon <?php 
                        if (!empty($offer_coupon_date)) {
                            echo $coupon_style;
                        }
                        ?>
" data-clipboard-text="<?php 
                        echo $offer_coupon;
                        ?>
"><i class="fa fa-scissors fa-rotate-180"></i><span class="coupon_text"><?php 
                        echo $offer_coupon;
                        ?>
</span></div>
                    <?php 
                    } else {
                        ?>
                      <div class="rehub_offer_coupon masked_coupon <?php 
                        if (!empty($offer_coupon_date)) {
                            echo $coupon_style;
                        }
                        ?>
" data-clipboard-text="<?php 
                        echo $offer_coupon;
                        ?>
" data-codeid="<?php 
                        echo $product->id;
                        ?>
" data-dest="<?php 
                        echo $offer_coupon_url;
                        ?>
"><?php 
                        if (rehub_option('rehub_mask_text') != '') {
                            echo rehub_option('rehub_mask_text');
                        } else {
                            _e('Reveal coupon', 'rehub_framework');
                        }
                        ?>
<i class="fa fa-external-link-square"></i></div>
                    <?php 
                    }
                    ?>
                    <?php 
                    if (!empty($offer_coupon_date)) {
                        echo '<div class="time_offer">' . $coupon_text . '</div>';
                    }
                    ?>
                <?php 
                }
                ?>
            </div>
    </div>
</div>
<?php 
                $i++;
            }
        }
        wp_reset_postdata();
        $post = $backup;
        ?>
</div>
<?php 
        if (!empty($result_min)) {
            $min_woo_price = min($result_min);
            //Get minimal woo price
            update_post_meta(get_the_ID(), 'rehub_min_woo_price', $min_woo_price);
            // save minimal price of price range affiliate links
        }
    }
示例#5
0
    if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
        ?>
                <figure>
                    <div class="pattern"></div>
                    <?php 
        rehub_formats_icons('full');
        ?>
                    <a href="<?php 
        the_permalink();
        ?>
"><?php 
        wpsm_thumb('grid_news');
        ?>
</a>
                </figure>                                     
        <?php 
    }
    ?>
   
    <?php 
}
?>
    <p><?php 
kama_excerpt('maxchar=320');
?>
</p>
	  <?php 
rehub_create_btn('yes');
?>
    
</article>
示例#6
0
"><?php 
        wpsm_thumb('news_big');
        ?>
</a>
        </figure>
        <div class="content_constructor">
            <h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
            <div class="rehub_catalog_desc">                                 
                <?php 
        kama_excerpt('maxchar=' . $exerpt_count . '');
        ?>
                       
            </div> 
            <?php 
        if ($enable_btn) {
            ?>
                <?php 
            rehub_create_btn('yes');
            ?>
            <?php 
        }
        ?>
        </div>                           
    </article>
<?php 
示例#7
0
" target="_blank"><?php 
    wpsm_thumb('med_thumbs');
    ?>
</a>    
        </div>
        <div class="desc_col">
            <div class="offer_title"><a href="<?php 
    echo $woolink;
    ?>
" target="_blank"><?php 
    the_title();
    ?>
</a></div>
            <p>
                <?php 
    kama_excerpt('maxchar=150');
    ?>
                <?php 
    $rehub_woo_review_related = get_post_meta(get_the_ID(), "review_woo_id", true);
    if (!empty($rehub_woo_review_related)) {
        ?>
                    <a href="<?php 
        echo get_permalink($rehub_woo_review_related);
        ?>
" target="_blank" class="color_link"><?php 
        _e("Read review", "rehub_framework");
        ?>
</a>
                    <div class="clearfix"></div>    
                <?php 
    }
示例#8
0
    function wpsm_toprating_shortcode($atts, $content = null)
    {
        extract(shortcode_atts(array('id' => '', 'full_width' => '0'), $atts));
        if (isset($atts['id']) && $atts['id']) {
            $toppost = get_post($atts['id']);
            $module_cats = get_post_meta($toppost->ID, 'top_review_cat', true);
            $module_tag = get_post_meta($toppost->ID, 'top_review_tag', true);
            $module_fetch = get_post_meta($toppost->ID, 'top_review_fetch', true);
            $module_ids = get_post_meta($toppost->ID, 'manual_ids', true);
            $order_choose = get_post_meta($toppost->ID, 'top_review_choose', true);
            $module_desc = get_post_meta($toppost->ID, 'top_review_desc', true);
            $module_desc_fields = get_post_meta($toppost->ID, 'top_review_custom_fields', true);
            $rating_circle = get_post_meta($toppost->ID, 'top_review_circle', true);
            $module_field_sorting = get_post_meta($toppost->ID, 'top_review_field_sort', true);
            $module_order = get_post_meta($toppost->ID, 'top_review_order', true);
            if ($module_fetch == '') {
                $module_fetch = '10';
            }
            if ($module_desc == '') {
                $module_desc = 'post';
            }
            if ($rating_circle == '') {
                $rating_circle = '1';
            }
            ob_start();
            ?>
                <div class="clearfix"></div>

                <?php 
            if ($order_choose == 'cat_choose') {
                ?>
	                <?php 
                $query = array('cat' => $module_cats, 'tag' => $module_tag, 'posts_per_page' => $module_fetch, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'rehub_review_overall_score', 'orderby' => 'meta_value_num', 'meta_query' => array(array('key' => 'rehub_framework_post_type', 'value' => 'review', 'compare' => 'LIKE')));
                ?>
 
                    <?php 
                if (!empty($module_field_sorting)) {
                    $query['meta_key'] = $module_field_sorting;
                }
                ?>
                    <?php 
                if ($module_order == 'asc') {
                    $query['order'] = 'ASC';
                }
                ?>
	                
            	<?php 
            } elseif ($order_choose == 'manual_choose' && $module_ids != '') {
                ?>
	                <?php 
                $query = array('post_status' => 'publish', 'ignore_sticky_posts' => 1, 'posts_per_page' => -1, 'orderby' => 'post__in', 'post__in' => $module_ids);
                ?>
            	<?php 
            } else {
                ?>
	                <?php 
                $query = array('posts_per_page' => $module_fetch, 'nopaging' => 0, 'post_status' => 'publish', 'ignore_sticky_posts' => 1, 'meta_key' => 'rehub_review_overall_score', 'orderby' => 'meta_value_num', 'meta_query' => array(array('key' => 'rehub_framework_post_type', 'value' => 'review', 'compare' => 'LIKE')));
                ?>
                    <?php 
                if (!empty($module_field_sorting)) {
                    $query['meta_key'] = $module_field_sorting;
                }
                ?>
                    <?php 
                if ($module_order == 'asc') {
                    $query['order'] = 'ASC';
                }
                ?>
	                             		
            	<?php 
            }
            ?>
	


                <?php 
            $loop = new WP_Query($query);
            $i = 0;
            if ($loop->have_posts()) {
                ?>
                <div class="top_rating_block<?php 
                if (isset($atts['full_width']) && $atts['full_width'] == '1') {
                    ?>
 full_width_rating<?php 
                } else {
                    ?>
 with_sidebar_rating<?php 
                }
                ?>
 list_style_rating">
                <?php 
                while ($loop->have_posts()) {
                    $loop->the_post();
                    $i++;
                    ?>
     
                    <div class="top_rating_item" id='rank_<?php 
                    echo $i;
                    ?>
'>                    
                        <div class="product_image_col">
                        	<?php 
                    if (vp_metabox('rehub_post_side.is_editor_choice') == '1') {
                        ?>
<div class="ed_choice_label"><img src="<?php 
                        echo get_template_directory_uri();
                        ?>
/images/editor_hor_badge.png" width="115" height="36" alt=""></div><?php 
                    }
                    ?>
                            <figure>
                            	<span class="rank_count"><?php 
                    if ($i == '1') {
                        ?>
<i class="fa fa-trophy"></i><?php 
                    } else {
                        echo $i;
                    }
                    ?>
</span>
                            	<a href="<?php 
                    the_permalink();
                    ?>
">
		                            <?php 
                    $img = get_post_thumb();
                    $nothumb = get_template_directory_uri() . '/images/default/noimage_100_70.png';
                    if (rehub_option('aq_resize_crop') == '1') {
                        $params = array('width' => 100);
                    } else {
                        $params = array('width' => 100, 'height' => 100, '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>
                        </div>                            
                    <div class="desc_col">
                        <h2><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
                        <p>
                        	<?php 
                    if ($module_desc == 'post') {
                        ?>
                        		<?php 
                        kama_excerpt('maxchar=120');
                        ?>
                        	<?php 
                    } elseif ($module_desc == 'review') {
                        ?>
                        		<?php 
                        echo wp_kses_post(vp_metabox('rehub_post.review_post.0.review_post_summary_text'));
                        ?>
                            <?php 
                    } elseif ($module_desc == 'field') {
                        ?>
                                <?php 
                        if (get_post_meta(get_the_ID(), $module_desc_fields, true)) {
                            ?>
                                    <?php 
                            echo get_post_meta(get_the_ID(), $module_desc_fields, true);
                            ?>
                                <?php 
                        }
                        ?>
                        		
                        	<?php 
                    } elseif ($module_desc == 'none') {
                        ?>
                        	<?php 
                    } else {
                        ?>
	
                        		<?php 
                        kama_excerpt('maxchar=120');
                        ?>
                    		<?php 
                    }
                    ?>
                        </p>
                        <div class="star"><?php 
                    rehub_get_user_results('small', 'yes');
                    ?>
</div>
                    </div>
                    <div class="rating_col">
                    <?php 
                    if ($rating_circle == '1') {
                        ?>
                        <?php 
                        $rating_score_clean = rehub_get_overall_score();
                        ?>
                        <div class="top-rating-item-circle-view">
	                        <div class="radial-progress" data-rating="<?php 
                        echo $rating_score_clean;
                        ?>
">
	                            <div class="circle">
	                                <div class="mask full">
	                                    <div class="fill"></div>
	                                </div>
	                                <div class="mask half">
	                                    <div class="fill"></div>
	                                    <div class="fill fix"></div>
	                                </div>
	                                
	                            </div>
	                            <div class="inset">
	                                <div class="percentage"><?php 
                        echo $rating_score_clean;
                        ?>
</div>
	                            </div>
	                        </div>
                        </div>
                    <?php 
                    } elseif ($rating_circle == '2') {
                        ?>
 
                        <div class="score square_score"> <span class="it_score"><?php 
                        echo rehub_get_overall_score();
                        ?>
</span></div>       
                    <?php 
                    } else {
                        ?>
                        <div class="score"> <span class="it_score"><?php 
                        echo rehub_get_overall_score();
                        ?>
</span></div>    
                    <?php 
                    }
                    ?>
                    </div>
                    <div class="buttons_col">
                    	<?php 
                    rehub_create_btn('');
                    ?>
                        <a href="<?php 
                    the_permalink();
                    ?>
" class="read_full"><?php 
                    if (rehub_option('rehub_review_text') != '') {
                        echo rehub_option('rehub_review_text');
                    } else {
                        _e('Read full review', 'rehub_framework');
                    }
                    ?>
</a>
                    </div>
                    </div>
                <?php 
                }
                ?>
                </div>
                <?php 
                wp_reset_query();
                ?>
                <?php 
            } else {
                _e('No posts for this criteria.', 'rehub_framework');
                ?>
                <?php 
            }
            ?>

    	<?php 
            $output = ob_get_contents();
            ob_end_clean();
            return $output;
        }
    }
示例#9
0
                                                <?php 
    $views = get_post_meta(get_the_ID(), 'views', true);
    echo empty($views) ? '0' : $views;
    ?>
                                            </span>
                                        </div>
                                        <h2 class="post_title"><?php 
    echo the_title();
    ?>
</h2>
                                        <a href="<?php 
    the_permalink();
    ?>
" title="" class="post-shot-content">
                                            <?php 
    kama_excerpt("maxchar=80");
    ?>
                                        </a>
                                    </li>
                                <?php 
}
wp_reset_postdata();
?>
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="orgs-paginate">
                    <?php 
global $wp_query;
$total = wp_count_posts('ads')->publish;
示例#10
0
    function woo_dealslinks_rehub()
    {
        ?>
<div class="deals_woo_rehub">
	<?php 
        $deal_title = vp_metabox('rehub_framework_woo.rehub_deals_title') ? vp_metabox('rehub_framework_woo.rehub_deals_title') : __('Choose your deal', 'rehub_framework');
        $rehub_woo_post_ids = vp_metabox('rehub_framework_woo.review_woo_list_links');
        if (!empty($rehub_woo_post_ids) && !is_array($rehub_woo_post_ids)) {
            $rehub_woo_post_ids = explode(',', $rehub_woo_post_ids);
        }
        $rehub_aff_post_ids = vp_metabox('rehub_framework_woo.review_woo_links');
        ?>
	<div class="title_deal_wrap"><div class="title_deal"><?php 
        echo esc_html($deal_title);
        ?>
</div></div>
	<?php 
        if (!empty($rehub_woo_post_ids)) {
            ?>
		<div class="wooaff_offer_links">
		<?php 
            $args = array('post__in' => $rehub_woo_post_ids, 'numberposts' => '-1', 'orderby' => 'post__in', 'post_type' => 'product', 'ignore_sticky_posts' => 1);
            global $post;
            global $woocommerce;
            $backup = $post;
            ?>
        <?php 
            $i = 1;
            $wp_query = new WP_Query($args);
            if ($wp_query->have_posts()) {
                ?>
                      
		<?php 
                while ($wp_query->have_posts()) {
                    $wp_query->the_post();
                    global $product;
                    ?>
		<?php 
                    $woolink = $product->product_type == 'external' ? $product->add_to_cart_url() : get_post_permalink(get_the_ID());
                    ?>
		<?php 
                    $term_ids = wp_get_post_terms(get_the_ID(), 'product_tag', array("fields" => "ids"));
                    if (!empty($term_ids)) {
                        $term_brand = $term_ids[0];
                        $term_brand_image = get_option("taxonomy_term_{$term_ids['0']}");
                    } else {
                        $term_brand_image = '';
                    }
                    $woo_img = get_post_thumb();
                    ?>
   
			<div class="woorow_aff">
				<div class="product-pic-wrapper">
					<a href="<?php 
                    echo $woolink;
                    ?>
" target="_blank"<?php 
                    if ($product->product_type == 'external') {
                        echo ' rel="nofollow"';
                    }
                    ?>
>
						<?php 
                    if (!empty($woo_img)) {
                        ?>
	
	            			<img src="<?php 
                        $params = array('width' => 100, 'height' => 100);
                        echo bfi_thumb($woo_img, $params);
                        ?>
" alt="<?php 
                        the_title_attribute();
                        ?>
" />
	            		<?php 
                    } elseif (!empty($term_brand_image['brand_image'])) {
                        ?>
	            			<img src="<?php 
                        $params = array('width' => 100, 'height' => 100);
                        echo bfi_thumb($term_brand_image['brand_image'], $params);
                        ?>
" alt="<?php 
                        the_title_attribute();
                        ?>
" />
	            		<?php 
                    } else {
                        ?>
	            			<img src="<?php 
                        echo get_template_directory_uri();
                        ?>
/images/default/noimage_100_70.png" alt="<?php 
                        the_title_attribute();
                        ?>
" />
	            		<?php 
                    }
                    ?>
	            	</a>				
				</div>
				<div class="product-details">
					<div class="product-name">
						<div class="aff_name"><a href="<?php 
                    echo $woolink;
                    ?>
" target="_blank"<?php 
                    if ($product->product_type == 'external') {
                        echo ' rel="nofollow"';
                    }
                    ?>
><?php 
                    the_title();
                    ?>
</a></div>
						<p><?php 
                    kama_excerpt('maxchar=150');
                    ?>
</p>
					</div>
					<div class="left_data_aff">
						<div class="wooprice_count">
						<?php 
                    if ($product->get_price() != '') {
                        ?>
							<?php 
                        echo $product->get_price_html();
                        ?>
						<?php 
                    }
                    ?>
	
						</div>					
						<div class="wooaff_tag">
				            <?php 
                    if (!empty($term_brand_image['brand_image'])) {
                        ?>
				            	<img src="<?php 
                        $params = array('width' => 100, 'height' => 100);
                        echo bfi_thumb($term_brand_image['brand_image'], $params);
                        ?>
" alt="<?php 
                        the_title_attribute();
                        ?>
" />
				            <?php 
                    } elseif (!empty($term_list[0])) {
                        ?>
 
				            	<?php 
                        echo $term_list[0];
                        ?>
				            <?php 
                    }
                    ?>
 							
						</div>
					</div>					
					<div class="woobuy_butt">
                    <?php 
                    if ($product->is_in_stock() && $product->add_to_cart_url() != '') {
                        ?>
                        <?php 
                        echo apply_filters('woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" data-product_id="%s" data-product_sku="%s" class="woobtn_offer_block %s product_type_%s"%s%s>%s</a>', esc_url($product->add_to_cart_url()), esc_attr($product->id), esc_attr($product->get_sku()), $product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : 'add_to_cart_button', esc_attr($product->product_type), $product->product_type == 'external' ? ' target="_blank"' : '', $product->product_type == 'external' ? ' rel="nofollow"' : '', $product->add_to_cart_text() ? esc_html($product->add_to_cart_text()) : __('See it', 'rehub_framework')), $product);
                        ?>
                    <?php 
                    }
                    ?>
					</div>
				</div>
			</div>
			<?php 
                }
            }
            wp_reset_postdata();
            $post = $backup;
            ?>
 
		</div>

	<?php 
        }
        ?>
	<?php 
        if (function_exists('thirstyInit') && !empty($rehub_aff_post_ids)) {
            ?>
		<div class="wooaff_offer_links">
		<?php 
            $rehub_aff_posts = get_posts(array('post_type' => 'thirstylink', 'post__in' => $rehub_aff_post_ids, 'meta_key' => 'rehub_aff_sticky', 'orderby' => 'meta_value', 'order' => 'DESC', 'numberposts' => '-1'));
            foreach ($rehub_aff_posts as $aff_post) {
                ?>
	
			<?php 
                $attachments = get_posts(array('post_type' => 'attachment', 'post_mime_type' => 'image', 'posts_per_page' => -1, 'post_parent' => $aff_post->ID));
                if (!empty($attachments)) {
                    $aff_thumb_list = wp_get_attachment_url($attachments[0]->ID);
                } else {
                    $aff_thumb_list = '';
                }
                $term_list = wp_get_post_terms($aff_post->ID, 'thirstylink-category', array("fields" => "names"));
                $term_ids = wp_get_post_terms($aff_post->ID, 'thirstylink-category', array("fields" => "ids"));
                if (!empty($term_ids)) {
                    $term_brand = $term_ids[0];
                    $term_brand_image = get_option("taxonomy_term_{$term_ids['0']}");
                } else {
                    $term_brand_image = '';
                }
                ?>
			<div class="woorow_aff">
				<div class="product-pic-wrapper">
					<a href="<?php 
                echo get_post_permalink($aff_post);
                ?>
">
						<?php 
                if (!empty($aff_thumb_list)) {
                    ?>
	
	            			<img src="<?php 
                    $params = array('width' => 100, 'height' => 100);
                    echo bfi_thumb($aff_thumb_list, $params);
                    ?>
" alt="<?php 
                    echo $aff_post->post_title;
                    ?>
" />
	            		<?php 
                } elseif (!empty($term_brand_image['brand_image'])) {
                    ?>
	            			<img src="<?php 
                    $params = array('width' => 100, 'height' => 100);
                    echo bfi_thumb($term_brand_image['brand_image'], $params);
                    ?>
" alt="<?php 
                    echo $aff_post->post_title;
                    ?>
" />
	            		<?php 
                } else {
                    ?>
	            			<img src="<?php 
                    echo get_template_directory_uri();
                    ?>
/images/default/noimage_100_70.png" alt="<?php 
                    echo $aff_post->post_title;
                    ?>
" />
	            		<?php 
                }
                ?>
	            	</a>				
				</div>
				<div class="product-details">
					<div class="product-name">
						<div class="aff_name"><a href="<?php 
                echo get_post_permalink($aff_post);
                ?>
"><?php 
                echo $aff_post->post_title;
                ?>
</a></div>
						<p><?php 
                echo get_post_meta($aff_post->ID, 'rehub_aff_desc', true);
                ?>
</p>
					</div>
					<div class="left_data_aff">
						<div class="wooprice_count">
							<?php 
                $product_price = get_post_meta($aff_post->ID, 'rehub_aff_price', true);
                ?>
							<?php 
                echo $product_price;
                ?>
						</div>					
						<div class="wooaff_tag">
				            <?php 
                if (!empty($term_brand_image['brand_image'])) {
                    ?>
				            	<img src="<?php 
                    $params = array('width' => 100, 'height' => 100);
                    echo bfi_thumb($term_brand_image['brand_image'], $params);
                    ?>
" alt="<?php 
                    the_title_attribute();
                    ?>
" />
				            <?php 
                } elseif (!empty($term_list[0])) {
                    ?>
 
				            	<?php 
                    echo $term_list[0];
                    ?>
				            <?php 
                }
                ?>
 							
						</div>
					</div>	
					<?php 
                $offer_btn_text = get_post_meta($aff_post->ID, 'rehub_aff_btn_text', true);
                ?>
				
					<div class="woobuy_butt">
						<a class="woobtn_offer_block" href="<?php 
                echo get_post_permalink($aff_post);
                ?>
" target="_blank" rel="nofollow"><?php 
                if ($offer_btn_text != '') {
                    echo $offer_btn_text;
                } elseif (rehub_option('rehub_btn_text') != '') {
                    echo rehub_option('rehub_btn_text');
                } else {
                    _e('See it', 'rehub_framework');
                }
                ?>
</a>
					</div>
				</div>
			</div>	
		<?php 
            }
            ?>
		</div>
	<?php 
        }
        ?>
</div>
<?php 
    }
示例#11
0
        $category = get_the_category(get_the_ID());
        $first_cat = $category[0]->term_id;
        meta_small(false, $first_cat, false, false);
        ?>
</div>
	            		</div>
	            		<h2><?php 
        rehub_permalink();
        the_title();
        ?>
</a></h2>
	            		<div class="hero-description"><?php 
        if ($dis_exerpt != '1') {
            ?>
<p><?php 
            kama_excerpt('maxchar=100');
            ?>
</p><?php 
        }
        ?>
</div>
	            		<?php 
        rehub_create_btn('yes');
        ?>
            		</div>
            	</div>
        	</li>
      	<?php 
    }
}
wp_reset_query();
                            <?php 
        }
        ?>
                            <h2><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>
                            <?php 
        if ($catalog_desc != '') {
            ?>
                                <div class="rehub_catalog_desc">                                 
                                    <?php 
            kama_excerpt('maxchar=' . $catalog_desc . '');
            ?>
                       
                                </div>
                            <?php 
        }
        ?>
                        
                            <?php 
        if ($catalog_fields[0]['catalog_fields_name'] != '') {
            ?>
                                <div class="rehub_catalog_fields">                                 
                                    <?php 
            $count = 1;
            foreach ($catalog_fields as $catalog_field) {
                ?>
示例#13
0
        ?>
                                </a>
                            </div>
                        <?php 
    }
    ?>
                        <h2><?php 
    the_title_shorten(50);
    ?>
</h2>
                        <a href="<?php 
    the_permalink();
    ?>
" title=""
                           class="post-shot-content"><?php 
    kama_excerpt("maxchar=200");
    ?>
</a>

                        <div class="post-time-view">
                            <?php 
    echo get_date_formatted(get_the_date('d.m.Y.H.i'), 'v');
    ?>
                            <span class="comments"><i class="comment-ico"></i>
                                <?php 
    comments_number('0', '1', '%');
    ?>
                                            </span>
                    <span class="view"><i class="view-ico"></i>
                        <?php 
    $views = get_post_meta(get_the_ID(), 'views', true);
    function rehub_get_review()
    {
        ?>

    <?php 
        $postAverage = get_post_meta(get_the_ID(), 'post_user_average', true);
        ?>

    <?php 
        $user_rates = get_post_meta(get_the_ID(), 'post_user_raitings', true);
        if (!empty($user_rates)) {
            $usercriterias = $user_rates['criteria'];
        }
        ?>

    <?php 
        if ($postAverage != '0' && $postAverage != '') {
            ?>
	

	<div class="rate_bar_wrap only_user_reviews<?php 
            if (rehub_option('color_type_review') == 'multicolor') {
                echo ' colored_rate_bar';
            }
            ?>
">

		<meta itemprop="description" content="<?php 
            kama_excerpt('maxchar=200');
            ?>
">

		<meta itemprop="url" content="<?php 
            the_permalink();
            ?>
">		

		<span class="user-reviews-title"><?php 
            the_title();
            ?>
</span>

		<div class="total-score-users-head">		

			<div class="review-top" itemprop="aggregateRating" itemscope="" itemtype="http://schema.org/AggregateRating">		

				<div class="overall-score">

					<span>	

						<span class="overall r_score_<?php 
            echo round($postAverage);
            ?>
" itemprop="ratingValue"><?php 
            echo round($postAverage, 1);
            ?>
</span>

						<span class="overall-text"><?php 
            _e('Total Score', 'rehub_framework');
            ?>
</span>

						<meta itemprop="bestRating" content="10"/>

						<meta itemprop="worstRating" content="1"/>

					</span>

				</div>

				<div class="overall-votes"><span itemprop="ratingCount"><?php 
            echo $user_rates['criteria'][0]['count'];
            ?>
</span> <?php 
            _e('reviews', 'rehub_framework');
            ?>
</div>	

				<a href="#respond" class="rehub_scroll add_user_review_link"><?php 
            _e("Add your review", "rehub_framework");
            ?>
</a>					

			</div>

		</div>	

		<div class="review-criteria user-review-criteria">

			<div class="r_criteria">

				<?php 
            foreach ($usercriterias as $usercriteria) {
                ?>

				<?php 
                $perc_criteria = $usercriteria['average'] * 10;
                ?>

				<div class="rate-bar user-rate-bar clearfix" data-percent="<?php 
                echo $perc_criteria;
                ?>
%">

					<div class="rate-bar-title"><span><?php 
                echo $usercriteria['name'];
                ?>
</span></div>

					<div class="rate-bar-bar r_score_<?php 
                echo round($usercriteria['average']);
                ?>
"></div>

					<div class="rate-bar-percent"><?php 
                echo $usercriteria['average'];
                ?>
</div>

				</div>

				<?php 
            }
            ?>

			</div>

		</div>	

	</div>

	<?php 
        }
        ?>

						  						



<?php 
    }
示例#15
0
function get_more_posts()
{
    $nonce = $_POST['nonce'];
    $qObjId = $_POST['term'];
    $tax = $_POST['tax'];
    $pType = $_POST['pType'];
    $offset = intval($_POST['offset']);
    $limit = intval($_POST['limit']);
    if (!wp_verify_nonce($nonce, 'ajax-nonce') || $offset == 0 || ($limit == 0 || $limit > 50) || is_array($offset)) {
        wp_die();
    }
    $types = get_post_types(array('public' => true), 'names');
    if (!in_array($pType, $types)) {
        wp_die();
    }
    $params = array('post_type' => $pType, 'posts_per_page' => $limit, 'offset' => $offset);
    $taxes = array('ncategory', 'ntag', 'adscategory', 'catcategory');
    if (!empty($tax) && in_array($tax, $taxes)) {
        if ($qObjId == 0 || is_array($qObjId)) {
            wp_die();
        }
        $params['tax_query'][] = array('taxonomy' => $tax, 'field' => 'id', 'terms' => $qObjId);
    }
    $posts = get_posts($params);
    $output = array();
    foreach ($posts as $post) {
        $row = array();
        $row['title'] = htmlspecialchars($post->post_title);
        $row['date'] = get_date_formatted(date_format(new DateTime($post->post_date), 'd.m.Y.H.i'));
        $row['link'] = get_permalink($post->ID);
        if ($post->post_type == 'news' || $post->post_type == 'ads') {
            $views = get_post_meta($post->ID, 'views', true);
            $row['views'] = empty($views) ? '0' : $views;
            if (has_post_thumbnail($post->ID)) {
                $img_url = wp_get_attachment_url(get_post_thumbnail_id($post->ID), 'full');
                $sizes = $post->post_type == 'news' ? array(60, 60) : array(96, 75);
                $row['src'] = aq_resize($img_url, $sizes[0], $sizes[1], true);
            } else {
                $row['src'] = $post->post_type == 'news' ? null : get_template_directory_uri() . '/images/blank_image.png';
            }
            if ($post->post_type == 'news') {
                $row['comments'] = get_comments_number($post->ID);
            }
            if ($post->post_type == 'ads') {
                $row['short'] = htmlspecialchars(kama_excerpt("maxchar=80&echo", $post));
            }
        }
        if ($post->post_type == 'catalog' || $post->post_type == 'ads') {
            $location = get_the_terms($post->ID, 'nlocation');
            if ($location) {
                $location = array_shift($location);
                $row['location'] = $location->name;
            } else {
                $row['location'] = "Уральск";
            }
            if ($post->post_type == 'catalog') {
                $contact = get_post_meta($post->ID, 'catalog_contacts', true);
                preg_match('#\\d+-\\d+-\\d+|\\d+ \\d+ \\d+|\\d+#ui', $contact, $phone_arr);
                $row['contact'] = count($phone_arr) > 0 ? $phone_arr[0] : ' - ';
            }
        }
        $output[] = $row;
    }
    exit(json_encode($output));
}
示例#16
0
                ?>
	        </figure>
	        <article>
				<div class="post-meta"> <?php 
                meta_all(false, $module_cats_second, false);
                ?>
 </div>	        
	            <h3><a href="<?php 
                the_permalink();
                ?>
"><?php 
                the_title();
                ?>
</a></h3> 
	            <p><?php 
                kama_excerpt('maxchar=160');
                ?>
</p>           
	        </article>
	     	<?php 
            } else {
                ?>
	     	<div class="f-post clearfix">
	            <figure> <a href="<?php 
                the_permalink();
                ?>
"><?php 
                wpsm_thumb('med_thumbs');
                ?>
</a><?php 
                rehub_formats_icons('small');
示例#17
0
                    <div class="col-md-10">
                        <p class="zag"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></p>
                        <p class="date"><?php 
        the_time('d.m.Y');
        ?>
</p>
                        <?php 
        $rrr = get_the_content();
        ?>
                        <p class="desc"><?php 
        kama_excerpt("text={$rrr}&maxchar=200");
        ?>
</p>
                    </div>
                </div>
            <?php 
    }
    ?>
            <?php 
}
?>
        </div>
    </main>
<?php 
get_footer();
示例#18
0
        setup_postdata($post);
        ?>
           	<div class="col-md-6 col-xs-12 news_about" >
           		<div class="img" style="background-image: url('<?php 
        echo wp_get_attachment_url(get_post_thumbnail_id($post->ID));
        ?>
')">
           			
           		</div>
           		<div class="block">
           			<h3><?php 
        the_title();
        ?>
</h3>
           			<p><?php 
        kama_excerpt();
        ?>
<p>
           			<div class="upper">
           				<span class="time"> <?php 
        the_time('j.m.Y');
        ?>
</span>
           				<a href="" title="Подробнее">Подробнее</a>
           			</div>
           		</div>
           		
           
           	</div>
             <?php 
    }
                rehub_get_user_resultsedd('small');
            }
            ?>
                        
                        </div>
                        <div class="edd_download_text">
                            <h3 class="edd_download_title" itemprop="name"><a href="<?php 
            the_permalink();
            ?>
"><?php 
            the_title_attribute();
            ?>
</a></h3>
                            <div class="edd_download_excerpt" itemprop="description">
                                <p><?php 
            kama_excerpt('maxchar=120');
            ?>
</p>
                            </div>
                        </div>
                        <div class="edd_download_buy_button">
                            <?php 
            echo edd_get_purchase_link(array('download_id' => get_the_ID()));
            ?>
                        </div>
                    </div> 
                </div> 
                <div class="clearfix"></div>              
                
            <?php 
        }
示例#20
0
文件: parhiv.php 项目: TimurMG/mg-red
								<?php 
        get_image_thumb(get_the_ID(), array(238, 160));
        ?>
</td>
<td valign="top" style="padding: 0 20px !important; background-color:#FFF5E1;   vertical-align: -webkit-baseline-middle;">
								<a href="<?php 
        the_permalink();
        ?>
" style="font-size:24px !important; display:block; margin-bottom:10px; padding:10px 0; border-bottom:1px #CCC dashed; color:#333; text-decoration:none;" >
								<?php 
        the_title_shorten(50);
        ?>
                                </a>
                                
                                <?php 
        echo htmlspecialchars(kama_excerpt('maxchar=200&echo'));
        ?>
</td>
</tr>
</table>
                            </div>

                        <?php 
    }
    wp_reset_postdata();
    ?>

                   

                </div>
示例#21
0
                }
                ?>
    
						</h4>
						<p itemprop="description">
							<?php 
                if ($video_schema_desc != '') {
                    ?>
								<?php 
                    echo $video_schema_desc;
                    ?>
							<?php 
                } else {
                    ?>
								<?php 
                    kama_excerpt('maxchar=250');
                    ?>
							<?php 
                }
                ?>
						</p>
					</div>
				</div>
			<?php 
            } else {
                ?>
		
				<?php 
                if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
                    ?>
					<?php 
示例#22
0
    ?>
  
    <?php 
} else {
    ?>
  
        <?php 
    if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
        ?>
               <figure><div class="pattern"></div><?php 
        rehub_formats_icons('full');
        the_post_thumbnail();
        ?>
</figure>                                     
        <?php 
    }
    ?>
  
    <?php 
}
?>
    
    <p><?php 
kama_excerpt('maxchar=300');
?>
</p>
    <?php 
rehub_create_btn('yes');
?>
<div class="post_share blog_end"></div>
</article>