Example #1
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 
    }
Example #2
0
}
?>
	    <?php 
$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 
Example #3
0
    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><?php 
                echo getHotLikeTitle(get_the_ID());
                ?>
<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 
    }
Example #4
0
    /**
     * 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;
        }
    }
Example #5
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;
    }