function get_home_recent($cat_data)
{
    $exclude = $Posts = $Box_Title = $pagination = $offset = '';
    if (!empty($cat_data['exclude'])) {
        $exclude = $cat_data['exclude'];
    }
    if (!empty($cat_data['number'])) {
        $Posts = $cat_data['number'];
    }
    if (!empty($cat_data['title'])) {
        $Box_Title = $cat_data['title'];
    }
    if (!empty($cat_data['display'])) {
        $display = $cat_data['display'];
    }
    if (!empty($cat_data['pagi'])) {
        $pagination = $cat_data['pagi'];
    }
    if (!empty($cat_data['offset'])) {
        $offset = $cat_data['offset'];
    }
    $args = array('posts_per_page' => $Posts, 'category__not_in' => $exclude, 'offset' => $offset, 'ignore_sticky_posts' => 1);
    if (!empty($pagination) && $pagination == 'y') {
        $args['paged'] = get_query_var('paged');
    } else {
        $args['no_found_rows'] = 1;
    }
    $cat_query = new WP_Query($args);
    ?>
		<section class="cat-box recent-box">
			<div class="cat-box-title">
				<h2><?php 
    if (function_exists('icl_t')) {
        echo icl_t(theme_name, $cat_data['boxid'], $Box_Title);
    } else {
        echo $Box_Title;
    }
    ?>
</h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
    if ($cat_query->have_posts()) {
        ?>

				<?php 
        while ($cat_query->have_posts()) {
            $cat_query->the_post();
            ?>
				<?php 
            if ($display == 'blog') {
                ?>
					<article <?php 
                tie_post_class('item-list');
                ?>
>
						<h2 class="post-box-title"><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a></h2>
						<?php 
                get_template_part('includes/boxes-meta');
                ?>
					

						<?php 
                if (tie_get_option('blog_display') == 'content') {
                    ?>
						<div class="entry">
							<?php 
                    the_content(__('Read More &raquo;', 'tie'));
                    ?>
						</div>
						
						<?php 
                } else {
                    ?>
						
							<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
						<div class="post-thumbnail">
							<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark">
								<?php 
                        the_post_thumbnail('thumbnail');
                        ?>
								<span class="overlay-icon"></span>
							</a>
						</div><!-- post-thumbnail /-->
							<?php 
                    }
                    ?>
									
						<div class="entry">
							<p><?php 
                    tie_excerpt();
                    ?>
							<a class="more-link" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    _e('Read More &raquo;', 'tie');
                    ?>
</a></p>
						</div>
						<?php 
                }
                ?>
						
						<?php 
                if (tie_get_option('archives_socail')) {
                    get_template_part('includes/post-share');
                }
                // Get Share Button template
                ?>
					</article><!-- .item-list -->
				<?php 
            } else {
                ?>
					<div <?php 
                tie_post_class('recent-item');
                ?>
>
						<?php 
                if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                    ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark">
									<?php 
                    tie_thumb('tie-medium');
                    ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
                }
                ?>
			
						<h3 class="post-box-title"><a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a></h3>
						<p class="post-meta">
							<?php 
                if (tie_get_option('box_meta_score')) {
                    tie_get_score();
                }
                ?>
							<?php 
                if (tie_get_option('box_meta_date')) {
                    tie_get_time();
                }
                ?>
						</p>
					</div>
				<?php 
            }
            ?>
				<?php 
        }
        ?>
				<div class="clear"></div>

			<?php 
    }
    ?>
			</div><!-- .cat-box-content /-->
		</section>
		<?php 
    if (!empty($pagination) && $pagination == 'y' && empty($offset) && $cat_query->max_num_pages > 1) {
        ?>
 <div class="recent-box-pagination"><?php 
        tie_pagenavi($cat_query, $Posts);
        ?>
 </div> <?php 
    }
    ?>
		<div class="clear"></div>
<?php 
}
Пример #2
0
            ?>
>
				<?php 
            if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                ?>
			
				<div class="post-thumbnail">
					<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark">
						<?php 
                tie_thumb('tie-medium');
                ?>
						<span class="overlay-icon"></span>
					</a>
				</div><!-- post-thumbnail /-->
				<?php 
            }
            ?>
			
				<h3><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
Пример #3
0
function tie_popular_posts($pop_posts = 5, $thumb = true)
{
    global $post;
    $orig_post = $post;
    $i = 0;
    $cat_query3 = new WP_Query(array('posts_per_page' => $pop_posts, 'orderby' => 'comment_count', 'post_status' => 'publish'));
    while ($cat_query3->have_posts()) {
        $cat_query3->the_post();
        $i++;
        ?>
<li>
	<?php 
        if (function_exists("has_post_thumbnail") && has_post_thumbnail() && $thumb) {
            ?>
			
		<div class="post-thumbnail">
			<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            tie_thumb();
            ?>
</a>
		</div><!-- post-thumbnail /-->
	<?php 
        }
        ?>
	<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
	<span class="date"><?php 
        the_time(get_option('date_format'));
        ?>
</span>
</li>
<?php 
        if ($i == $pop_posts) {
            break;
        }
    }
    $post = $orig_post;
}
function get_home_news_videos($cat_data)
{
    $Cat_ID = $cat_data['id'];
    $offset = $Box_Title = '';
    if (!empty($cat_data['title'])) {
        $Box_Title = $cat_data['title'];
    }
    if (!empty($cat_data['offset'])) {
        $offset = $cat_data['offset'];
    }
    $count = 0;
    $cat_query = new WP_Query(array('cat' => $Cat_ID, 'posts_per_page' => 4, 'offset' => $offset, 'no_found_rows' => 1, 'meta_query' => array('relation' => 'OR', array('key' => 'tie_video_url', 'value' => ' ', 'compare' => '!='), array('key' => 'tie_embed_code', 'value' => ' ', 'compare' => '!='))));
    ?>
		<section class="cat-box video-box clear">
			<div class="cat-box-title">
				<h2><a href="<?php 
    echo get_category_link($Cat_ID);
    ?>
"><?php 
    if (function_exists('icl_t')) {
        echo icl_t(theme_name, $cat_data['boxid'], $Box_Title);
    } else {
        echo $Box_Title;
    }
    ?>
</a></h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
    if ($cat_query->have_posts()) {
        ?>
				<ul>
				<?php 
        while ($cat_query->have_posts()) {
            $cat_query->the_post();
            $count++;
            ?>
				<?php 
            if ($count == 1) {
                ?>
					<li <?php 
                tie_post_class('big-video-column');
                ?>
>
						<?php 
                tie_video();
                ?>
					</li><!-- .first-news -->
					<?php 
            } else {
                ?>
					<?php 
                if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                    ?>
			
					<li <?php 
                    tie_post_class('videos-item' . $count);
                    ?>
>
						<div class="post-thumbnail">
							<a class="ttip" href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    the_title();
                    ?>
" rel="bookmark"><?php 
                    tie_thumb('tie-medium');
                    ?>
<span class="overlay-icon"></span></a>
						</div><!-- post-thumbnail /-->
					</li>
					<?php 
                }
                ?>
			
					<?php 
            }
            ?>
				<?php 
        }
        ?>
				</ul>
				<div class="clear"></div>
				<?php 
    }
    ?>
			</div><!-- .cat-box-content /-->
		</section><!-- Videos Box -->
<?php 
}
		<ul class="slides">
		<?php 
                while ($featured_query->have_posts()) {
                    $featured_query->the_post();
                    ?>
			<li>
			<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
				<a href="<?php 
                        the_permalink();
                        ?>
">
				<?php 
                        tie_thumb('slider');
                        ?>
				</a>
			<?php 
                    }
                    ?>
				<div class="slider-caption">
					<h2><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
					<?php 
                    if (tie_get_option('slider_caption')) {
function get_home_scroll($cat_data)
{
    ?>
	
<?php 
    wp_enqueue_script('tie-cycle');
    $Cat_ID = $cat_data['id'];
    $offset = $Box_Title = $Posts = '';
    if (!empty($cat_data['number'])) {
        $Posts = $cat_data['number'];
    }
    if (!empty($cat_data['title'])) {
        $Box_Title = $cat_data['title'];
    }
    if (!empty($cat_data['offset'])) {
        $offset = $cat_data['offset'];
    }
    $cat_query = new WP_Query('cat=' . $Cat_ID . '&no_found_rows=1&posts_per_page=' . $Posts . '&offset=' . $offset);
    ?>
		<section class="cat-box scroll-box">
			<div class="cat-box-title">
				<h2><a href="<?php 
    echo get_category_link($Cat_ID);
    ?>
"><?php 
    if (function_exists('icl_t')) {
        echo icl_t(theme_name, $cat_data['boxid'], $Box_Title);
    } else {
        echo $Box_Title;
    }
    ?>
</a></h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
				<?php 
    if ($cat_query->have_posts()) {
        ?>
				<div id="slideshow<?php 
        echo $Cat_ID;
        ?>
" class="group_items-box">
				<?php 
        while ($cat_query->have_posts()) {
            $cat_query->the_post();
            ?>
					<div <?php 
            tie_post_class('scroll-item');
            ?>
>
						<?php 
            if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark">
									<?php 
                tie_thumb('tie-medium');
                ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
            }
            ?>
			
						<h3 class="post-box-title"><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            the_title();
            ?>
</a></h3>
						<p class="post-meta">
							<?php 
            if (tie_get_option('box_meta_score')) {
                tie_get_score();
            }
            ?>
							<?php 
            if (tie_get_option('box_meta_date')) {
                tie_get_time();
            }
            ?>
						</p>
					</div>
				<?php 
        }
        ?>
				<div class="clear"></div>
				</div>
				<div id="nav<?php 
        echo $Cat_ID;
        ?>
" class="scroll-nav"></div>
					<?php 
    }
    ?>
			</div><!-- .cat-box-content /-->
		</section>
		<div class="clear"></div>
<script type="text/javascript">
	jQuery(document).ready(function() {
		var vids = jQuery("#slideshow<?php 
    echo $Cat_ID;
    ?>
 .scroll-item");
		for(var i = 0; i < vids.length; i+=4) {
		  vids.slice(i, i+4).wrapAll('<div class="group_items"></div>');
		}
		jQuery(function() {
			jQuery('#slideshow<?php 
    echo $Cat_ID;
    ?>
').cycle({
				fx:     'scrollHorz',
				timeout: 3000,
				pager:  '#nav<?php 
    echo $Cat_ID;
    ?>
',
				slideExpr: '.group_items',
				speed: 300,
				pause: true
			});
		});
  });
</script>
<?php 
}
Пример #7
0
<?php

if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
    ?>
<div class="post-media">
	<a href="<?php 
    echo get_large_thumb();
    ?>
" rel="prettyPhoto"><?php 
    tie_thumb(tie_post_width());
    ?>
</a>
</div>
<?php 
}
?>

<?php 
if (is_singular()) {
    ?>
	<h1 class="entry-title"><?php 
    the_title();
    ?>
</h1>
	<?php 
    tie_include('post-meta');
    // Get Post Meta template
    ?>
	
	<div class="entry">
		<?php 
Пример #8
0
    } elseif ($get_meta['tie_post_head'][0] == 'lightbox' && has_post_thumbnail($post->ID)) {
        $image_id = get_post_thumbnail_id($post->ID);
        $image_url = wp_get_attachment_image_src($image_id, 'large');
        $image_url = $image_url[0];
        if ($get_meta["tie_sidebar_pos"][0] == 'full') {
            $size = 'big-slider';
        } else {
            $size = 'slider';
        }
        ?>
		<div class="single-post-thumb head-lightbox">
			<a href="<?php 
        echo $image_url;
        ?>
" rel="prettyPhoto"><?php 
        tie_thumb($size);
        ?>
</a>
		</div>
		<?php 
        $thumb_caption = get_post(get_post_thumbnail_id())->post_excerpt;
        if (!empty($thumb_caption)) {
            ?>
<div class="single-post-caption"><?php 
            echo $thumb_caption;
            ?>
</div> <?php 
        }
        ?>
			
<?php 
Пример #9
0
            ?>
			<div class="related-item">
				<?php 
            if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                ?>
			
				<div class="post-thumbnail">
					<a href="<?php 
                the_permalink();
                ?>
" title="<?php 
                printf(__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                ?>
" rel="bookmark">
						<?php 
                tie_thumb();
                ?>
					</a>
				</div><!-- post-thumbnail /-->
				<?php 
            }
            ?>
			
				<h3><a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            the_title();
Пример #10
0
function tie_best_reviews_posts($pop_posts = 5, $thumb = true)
{
    global $post;
    $orig_post = $post;
    $cat_query1 = new WP_Query(array('posts_per_page' => $pop_posts, 'orderby' => 'meta_value_num', 'meta_key' => 'tie_review_score', 'post_status' => 'publish', 'no_found_rows' => 1));
    while ($cat_query1->have_posts()) {
        $cat_query1->the_post();
        ?>
<li <?php 
        tie_post_class();
        ?>
>
	<?php 
        if (function_exists("has_post_thumbnail") && has_post_thumbnail() && $thumb) {
            ?>
			
		<div class="post-thumbnail">
			<a href="<?php 
            the_permalink();
            ?>
" title="<?php 
            printf(__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
            ?>
" rel="bookmark"><?php 
            tie_thumb();
            ?>
<span class="overlay-icon"></span></a>
		</div><!-- post-thumbnail /-->
	<?php 
        }
        ?>
	<h3><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
	<?php 
        tie_get_score();
        ?>
 <span class="date"><?php 
        tie_get_time();
        ?>
</span>
</li>
<?php 
    }
    $post = $orig_post;
}
Пример #11
0
    function widget($args, $instance)
    {
        extract($args);
        $no_of_posts = $instance['no_of_posts'];
        $cats_id = $instance['cats_id'];
        $custom_slider = $instance['custom_slider'];
        $argss = array('posts_per_page' => $no_of_posts, 'category__in' => $cats_id, 'no_found_rows' => 1);
        $featured_query = new WP_Query($argss);
        ?>
	<?php 
        if (empty($custom_slider)) {
            if ($featured_query->have_posts()) {
                ?>
	<div class="flexslider" id="<?php 
                echo $args['widget_id'];
                ?>
">
		<ul class="slides">
		<?php 
                while ($featured_query->have_posts()) {
                    $featured_query->the_post();
                    ?>
			<li>
			<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
				<a href="<?php 
                        the_permalink();
                        ?>
">
				<?php 
                        tie_thumb('tie-large');
                        ?>
				</a>
			<?php 
                    }
                    ?>
				<div class="slider-caption">
					<h2><a href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    the_title();
                    ?>
</a></h2>
				</div>
			</li>
		<?php 
                }
                ?>
		</ul>
	</div>
	<?php 
            }
            ?>
	<?php 
        } else {
            $custom_slider_args = array('post_type' => 'tie_slider', 'p' => $custom_slider, 'no_found_rows' => 1);
            $custom_slider_query = new WP_Query($custom_slider_args);
            ?>
	<div class="flexslider" id="<?php 
            echo $args['widget_id'];
            ?>
">
		<ul class="slides">
		<?php 
            while ($custom_slider_query->have_posts()) {
                $custom_slider_query->the_post();
                $custom = get_post_custom($post->ID);
                $slider = unserialize($custom["custom_slider"][0]);
                $number = count($slider);
                if ($slider) {
                    foreach ($slider as $slide) {
                        ?>
	
			<li>
				<?php 
                        if (!empty($slide['link'])) {
                            ?>
<a href="<?php 
                            echo stripslashes($slide['link']);
                            ?>
"><?php 
                        }
                        ?>
				<img src="<?php 
                        echo tie_slider_img_src($slide['id'], 'tie-large');
                        ?>
" alt="" />
				<?php 
                        if (!empty($slide['link'])) {
                            ?>
</a><?php 
                        }
                        ?>
				<?php 
                        if (!empty($slide['title']) || !empty($slide['caption'])) {
                            ?>
				<div class="slider-caption">
					<?php 
                            if (!empty($slide['title'])) {
                                ?>
<h2><?php 
                                if (!empty($slide['link'])) {
                                    ?>
<a href="<?php 
                                    echo stripslashes($slide['link']);
                                    ?>
"><?php 
                                }
                                echo stripslashes($slide['title']);
                                if (!empty($slide['link'])) {
                                    ?>
</a><?php 
                                }
                                ?>
</h2><?php 
                            }
                            ?>
					<?php 
                            if (!empty($slide['caption'])) {
                                ?>
<p><?php 
                                echo stripslashes($slide['caption']);
                                ?>
</p><?php 
                            }
                            ?>
				</div>
				<?php 
                        }
                        ?>
			</li>
			<?php 
                    }
                }
                ?>
		<?php 
            }
            ?>
		</ul>
	</div>
	<?php 
        }
        ?>
	<script>
	jQuery(document).ready(function() {
	  jQuery('#<?php 
        echo $args['widget_id'];
        ?>
').flexslider({
		animation: "fade",
		slideshowSpeed: 7000,
		animationSpeed: 600,
		randomize: false,
		pauseOnHover: true,
		prevText: "",
		nextText: "",
		controlNav: false
	  });
	});
	</script>
	<?php 
    }
Пример #12
0
function get_home_news_pic($cat_data)
{
    $Cat_ID = $cat_data['id'];
    $Posts = 13;
    $offset = $Box_style = $Box_Title = '';
    if (!empty($cat_data['title'])) {
        $Box_Title = $cat_data['title'];
    }
    if (!empty($cat_data['style'])) {
        $Box_style = $cat_data['style'];
    }
    if ($Box_style == 'row') {
        $Posts = 16;
    }
    if (!empty($cat_data['offset'])) {
        $offset = $cat_data['offset'];
    }
    $cat_query = new WP_Query('cat=' . $Cat_ID . '&no_found_rows=1&posts_per_page=' . $Posts . '&offset=' . $offset);
    ?>
		<section class="cat-box pic-box clear">
			<div class="cat-box-title">
			<h2><a href="<?php 
    echo get_category_link($Cat_ID);
    ?>
"><?php 
    if (function_exists('icl_t')) {
        echo icl_t(theme_name, $cat_data['boxid'], $Box_Title);
    } else {
        echo $Box_Title;
    }
    ?>
</a></h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
    if ($cat_query->have_posts()) {
        $count = 0;
        ?>
				<ul>
				<?php 
        while ($cat_query->have_posts()) {
            $cat_query->the_post();
            $count++;
            ?>
				<?php 
            if ($count == 1 && $Box_style != 'row') {
                ?>
					<li class="first-pic">
						<?php 
                if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                    ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    tie_thumb('tie-large');
                    ?>
								<h2><?php 
                    the_title();
                    ?>
</h2></a>
							</div><!-- post-thumbnail /-->
						<?php 
                }
                ?>
					</li><!-- .first-pic -->
					<?php 
            } else {
                ?>
					<li>
						<?php 
                if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                    ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    the_title();
                    ?>
" class="ttip"><?php 
                    tie_thumb();
                    ?>
</a>
							</div><!-- post-thumbnail /-->
						<?php 
                }
                ?>
			
					</li>
					<?php 
            }
            ?>
				<?php 
        }
        ?>
				</ul>
				<div class="clear"></div>
					<?php 
    }
    ?>
			</div><!-- .cat-box-content /-->
		</section>	
<?php 
}
Пример #13
0
function get_home_cats($cat_data)
{
    ?>

<?php 
    global $count2;
    $Cat_ID = $cat_data['id'];
    $rand = $offset = $order = $Posts = '';
    if (!empty($cat_data['number'])) {
        $Posts = $cat_data['number'];
    }
    if (!empty($cat_data['order'])) {
        $order = $cat_data['order'];
    }
    if (!empty($cat_data['offset'])) {
        $offset = $cat_data['offset'];
    }
    if ($order == 'rand') {
        $rand = "&orderby=rand";
    }
    $cat_query = new WP_Query('cat=' . $Cat_ID . '&no_found_rows=1&posts_per_page=' . $Posts . $rand . '&offset=' . $offset);
    $cat_title = get_the_category_by_ID($Cat_ID);
    $count = 0;
    $home_layout = $cat_data['style'];
    ?>
	<?php 
    if ($home_layout == '2c') {
        //************** 2C ******************************************************
        ?>
		<?php 
        $count2++;
        ?>
		<section class="cat-box column2 <?php 
        if ($count2 == 2) {
            echo 'last-column';
            $count2 = 0;
        }
        ?>
">
			<div class="cat-box-title">
				<h2><a href="<?php 
        echo get_category_link($Cat_ID);
        ?>
"><?php 
        echo $cat_title;
        ?>
</a></h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
        if ($cat_query->have_posts()) {
            ?>
				<ul>
				<?php 
            while ($cat_query->have_posts()) {
                $cat_query->the_post();
                $count++;
                ?>
				<?php 
                if ($count == 1) {
                    ?>
					<li <?php 
                    tie_post_class('first-news');
                    ?>
>
						<div class="inner-content">
						<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark">
									<?php 
                        tie_thumb('tie-medium');
                        ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
                    }
                    ?>
					
						<h2 class="post-box-title"><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    the_title();
                    ?>
</a></h2>
						
							<?php 
                    get_template_part('includes/boxes-meta');
                    ?>
					
							<div class="entry">
								<?php 
                    tie_excerpt_home();
                    ?>
								<a class="more-link" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    _e('Read More &raquo;', 'tie');
                    ?>
</a>
							</div>
						</div>
					</li><!-- .first-news -->
					<?php 
                } else {
                    ?>
					<li <?php 
                    tie_post_class();
                    ?>
>
						<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark"><?php 
                        tie_thumb();
                        ?>
<span class="overlay-icon"></span></a>
							</div><!-- post-thumbnail /-->
						<?php 
                    }
                    ?>
			
						<h3 class="post-box-title"><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    the_title();
                    ?>
</a></h3>
						<?php 
                    get_template_part('includes/boxes-meta');
                    ?>
					
					</li>
					<?php 
                }
                ?>
				<?php 
            }
            ?>
				</ul>

				<?php 
        }
        ?>
			</div><!-- .cat-box-content /-->
		</section> <!-- Two Columns -->
		
		
	<?php 
    } elseif ($home_layout == '1c') {
        //************** 1C ******************************************************
        ?>
		<section class="cat-box wide-box">
			<div class="cat-box-title">
				<h2><a href="<?php 
        echo get_category_link($Cat_ID);
        ?>
"><?php 
        echo $cat_title;
        ?>
</a></h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
        if ($cat_query->have_posts()) {
            ?>
				<ul>
				<?php 
            while ($cat_query->have_posts()) {
                $cat_query->the_post();
                $count++;
                ?>
				<?php 
                if ($count == 1) {
                    ?>
					<li <?php 
                    tie_post_class('first-news');
                    ?>
>
						<div class="inner-content">
						<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark">
									<?php 
                        tie_thumb('tie-large');
                        ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
                    }
                    ?>
					
						<h2 class="post-box-title"><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    the_title();
                    ?>
</a></h2>
						
							<?php 
                    get_template_part('includes/boxes-meta');
                    ?>
					
							<div class="entry">
								<?php 
                    tie_excerpt_home();
                    ?>
								<a class="more-link" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    _e('Read More &raquo;', 'tie');
                    ?>
</a>
							</div>
						</div>
					</li><!-- .first-news -->
					<?php 
                } else {
                    ?>
					<li <?php 
                    tie_post_class();
                    ?>
>
						<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark"><?php 
                        tie_thumb();
                        ?>
<span class="overlay-icon"></span></a>
							</div><!-- post-thumbnail /-->
						<?php 
                    }
                    ?>
			
						<h3 class="post-box-title"><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    the_title();
                    ?>
</a></h3>
						<?php 
                    get_template_part('includes/boxes-meta');
                    ?>
					
					</li>
					<?php 
                }
                ?>
				<?php 
            }
            ?>
				</ul>
				<div class="clear"></div>

					<?php 
        }
        ?>
			</div><!-- .cat-box-content /-->
		</section><!-- Wide Box -->

	<?php 
    } else {
        //************** list **********************************************************************************
        ?>
		
		<section class="cat-box list-box">
			<div class="cat-box-title">
				<h2><a href="<?php 
        echo get_category_link($Cat_ID);
        ?>
"><?php 
        echo $cat_title;
        ?>
</a></h2>
				<div class="stripe-line"></div>
			</div><!-- post-thumbnail /-->
			<div class="cat-box-content">
			
				<?php 
        if ($cat_query->have_posts()) {
            ?>
				<ul>
				<?php 
            while ($cat_query->have_posts()) {
                $cat_query->the_post();
                $count++;
                ?>
				<?php 
                if ($count == 1) {
                    ?>
					<li <?php 
                    tie_post_class('first-news');
                    ?>
>
						<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark">
									<?php 
                        tie_thumb('tie-medium');
                        ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
                    }
                    ?>
					
						<h2 class="post-box-title"><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    the_title();
                    ?>
</a></h2>
						
							<?php 
                    get_template_part('includes/boxes-meta');
                    ?>
					
							<div class="entry">
								<?php 
                    tie_excerpt_home();
                    ?>
								<a class="more-link" href="<?php 
                    the_permalink();
                    ?>
"><?php 
                    _e('Read More &raquo;', 'tie');
                    ?>
</a>
							</div>
						</li><!-- .first-news -->
					<?php 
                } else {
                    ?>
					<li <?php 
                    tie_post_class('other-news');
                    ?>
>
						<?php 
                    if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                        ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark"><?php 
                        tie_thumb();
                        ?>
<span class="overlay-icon"></span></a>
							</div><!-- post-thumbnail /-->
						<?php 
                    }
                    ?>
			
						<h3 class="post-box-title"><a href="<?php 
                    the_permalink();
                    ?>
" title="<?php 
                    printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                    ?>
" rel="bookmark"><?php 
                    the_title();
                    ?>
</a></h3>
						<?php 
                    get_template_part('includes/boxes-meta');
                    ?>
					</li>
					<?php 
                }
                ?>
				<?php 
            }
            ?>
				</ul>
				<div class="clear"></div>

					<?php 
        }
        ?>
			</div><!-- .cat-box-content /-->
		</section><!-- List Box -->

	<?php 
    }
}
Пример #14
0
function tie_home_tabs()
{
    $home_tabs_active = tie_get_option('home_tabs_box');
    $home_tabs = tie_get_option('home_tabs');
    $Posts = 5;
    if ($home_tabs_active && $home_tabs) {
        ?>
	<div id="cats-tabs-box" class="cat-box-content clear cat-box">
		<div class="cat-tabs-header">
			<ul>
		<?php 
        foreach ($home_tabs as $cat) {
            ?>
				<li><a href="#catab<?php 
            echo $cat;
            ?>
"><?php 
            echo get_the_category_by_ID($cat);
            ?>
</a></li>
			<?php 
        }
        ?>
			</ul>
		</div>
		<?php 
        $cat_num = 0;
        foreach ($home_tabs as $cat) {
            $count = 0;
            $cat_num++;
            $cat_query = new WP_Query('cat=' . $cat . '&no_found_rows=1&posts_per_page=' . $Posts);
            ?>
			<div id="catab<?php 
            echo $cat;
            ?>
" class="cat-tabs-wrap cat-tabs-wrap<?php 
            echo $cat_num;
            ?>
">

			<?php 
            if ($cat_query->have_posts()) {
                ?>
				<ul>
				<?php 
                while ($cat_query->have_posts()) {
                    $cat_query->the_post();
                    $count++;
                    ?>
				<?php 
                    if ($count == 1) {
                        ?>
					<li <?php 
                        tie_post_class('first-news');
                        ?>
>
						<?php 
                        if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                            ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                            the_permalink();
                            ?>
" title="<?php 
                            printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                            ?>
" rel="bookmark">
									<?php 
                            tie_thumb('tie-medium');
                            ?>
									<span class="overlay-icon"></span>
								</a>
							</div><!-- post-thumbnail /-->
						<?php 
                        }
                        ?>
					
						<h2 class="post-box-title"><a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark"><?php 
                        the_title();
                        ?>
</a></h2>
						<?php 
                        get_template_part('includes/boxes-meta');
                        ?>
					
						<div class="entry">
							<?php 
                        tie_excerpt_home();
                        ?>
							<a class="more-link" href="<?php 
                        the_permalink();
                        ?>
"><?php 
                        _e('Read More &raquo;', 'tie');
                        ?>
</a>
						</div>
					</li><!-- .first-news -->
					<?php 
                    } else {
                        ?>
					<li <?php 
                        tie_post_class();
                        ?>
>
						<?php 
                        if (function_exists("has_post_thumbnail") && has_post_thumbnail()) {
                            ?>
			
							<div class="post-thumbnail">
								<a href="<?php 
                            the_permalink();
                            ?>
" title="<?php 
                            printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                            ?>
" rel="bookmark"><?php 
                            tie_thumb();
                            ?>
<span class="overlay-icon"></span></a>
							</div><!-- post-thumbnail /-->
						<?php 
                        }
                        ?>
			
						<h3 class="post-box-title"><a href="<?php 
                        the_permalink();
                        ?>
" title="<?php 
                        printf(esc_attr__('Permalink to %s', 'tie'), the_title_attribute('echo=0'));
                        ?>
" rel="bookmark"><?php 
                        the_title();
                        ?>
</a></h3>
						<?php 
                        get_template_part('includes/boxes-meta');
                        ?>
					
					</li>
					<?php 
                    }
                    ?>
				<?php 
                }
                ?>
				</ul>
				<div class="clear"></div>
			<?php 
            }
            ?>
			</div>
			<?php 
        }
        ?>
	</div><!-- #cats-tabs-box /-->
<?php 
    }
}