function get_home_cats($cat_data) { global $columns; $Cat_ID = $cat_data['id']; $offset = $Posts_num = $order = $rand = ''; if (!empty($cat_data['number'])) { $Posts_num = $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_num . $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 $columns++; ?> <section class="cat-box column2 tie-cat-<?php echo $Cat_ID; ?> <?php if ($columns == 2) { echo 'last-column'; $columns = 0; } ?> "> <h2 class="cat-box-title"><a href="<?php echo get_category_link($Cat_ID); ?> "><?php echo $cat_title; ?> </a></h2> <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 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 the_post_thumbnail('tie-large'); ?> <?php tie_get_score(true); ?> </a> </div><!-- post-thumbnail /--> <?php } else { ?> <div class="empty-space"></div> <?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"> <p><?php tie_excerpt_home(); ?> </p> <a class="more-link" href="<?php the_permalink(); ?> "><?php _e('Read More »', 'tie'); ?> </a> </div> </div> </li><!-- .first-news --> <?php } else { ?> <li> <?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('tie-small'); ?> <?php tie_get_score(); ?> </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 tie-cat-<?php echo $Cat_ID; ?> "> <h2 class="cat-box-title"><a href="<?php echo get_category_link($Cat_ID); ?> "><?php echo $cat_title; ?> </a></h2> <div class="cat-box-content"> <?php $count = 0; $count2 = 0; if ($cat_query->have_posts()) { ?> <ul> <?php while ($cat_query->have_posts()) { $cat_query->the_post(); $count++; ?> <?php if ($count == 1) { ?> <li 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 the_post_thumbnail('tie-large'); ?> <?php tie_get_score(true); ?> </a> </div><!-- post-thumbnail /--> <?php } else { ?> <div class="empty-space"></div> <?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"> <p><?php tie_excerpt_home(); ?> </p> <a class="more-link" href="<?php the_permalink(); ?> "><?php _e('Read More »', 'tie'); ?> </a> </div> </div> </li><!-- .first-news --> <?php } else { $count2++; ?> <li <?php if ($count2 == 2) { echo 'class="last-column"'; $count2 = 0; } ?> > <?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('tie-small'); ?> <?php tie_get_score(); ?> </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 tie-cat-<?php echo $Cat_ID; ?> "> <h2 class="cat-box-title"><a href="<?php echo get_category_link($Cat_ID); ?> "><?php echo $cat_title; ?> </a></h2> <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 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 the_post_thumbnail('tie-large'); ?> <?php tie_get_score(true); ?> </a> </div><!-- post-thumbnail /--> <?php } else { ?> <div class="empty-space"></div> <?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"> <p><?php tie_excerpt_home(); ?> </p> <a class="more-link" href="<?php the_permalink(); ?> "><?php _e('Read More »', 'tie'); ?> </a> </div> </li><!-- .first-news --> <?php } else { ?> <li 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 the_post_thumbnail('tie-small'); ?> <?php tie_get_score(); ?> </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 } ?> <?php }
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 »', '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 »', '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 }
<p class="post-meta"> <?php if (tie_get_option('arc_meta_score')) { tie_get_score(); } if (tie_get_option('arc_meta_author')) { ?> <span><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " title="<?php sprintf(esc_attr__('View all posts by %s', 'tie'), get_the_author()); ?> "><?php echo get_the_author(); ?> </a></span> <?php } ?> <?php if (tie_get_option('arc_meta_date')) { ?> <?php tie_get_time(); } ?>
function tie_best_reviews_posts($posts_number = 5, $thumb = true) { global $post; $original_post = $post; $args = array('orderby' => 'meta_value_num', 'meta_key' => 'taq_review_score', 'posts_per_page' => $posts_number, 'post_status' => 'publish', 'no_found_rows' => true, 'ignore_sticky_posts' => true); $best_views = new WP_Query($args); if ($best_views->have_posts()) { while ($best_views->have_posts()) { $best_views->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(); ?> " rel="bookmark"><?php the_post_thumbnail('tie-small'); ?> <span class="fa overlay-icon"></span></a> </div><!-- post-thumbnail /--> <?php } ?> <h3><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php tie_get_score(); ?> <?php tie_get_time(); ?> </li> <?php } } $post = $original_post; wp_reset_query(); }
<?php global $get_meta; ?> <p class="post-meta"> <?php if( !empty( $get_meta[ 'box_meta_score' ][0] ) ) tie_get_score(); ?> <?php if( !empty( $get_meta[ 'box_meta_author' ][0] ) ): ?> <span class="post-meta-author"><i class="fa fa-user"></i><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) )?>" title=""><?php echo get_the_author() ?> </a></span> <?php endif; ?> <?php if( !empty( $get_meta[ 'box_meta_date' ][0] ) ) tie_get_time() ?> <?php if( !empty( $get_meta[ 'box_meta_cats' ][0] ) ): ?> <span class="post-cats"><i class="fa fa-folder"></i><?php printf('%1$s', get_the_category_list( ', ' ) ); ?></span> <?php endif; ?> <?php if( !empty( $get_meta[ 'box_meta_comments' ][0] ) ): ?> <span class="post-comments"><i class="fa fa-comments"></i><?php comments_popup_link( '0' , '1' , '%' ); ?></span> <?php endif; ?> <?php if( !empty( $get_meta[ 'box_meta_views' ][0] ) ): ?> <?php echo tie_views(); ?> <?php endif; ?> </p>
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 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 the_post_thumbnail('tie-small'); ?> </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; }
function get_home_scroll($cat_data) { wp_enqueue_script('tie-cycle'); $Cat_ID = $cat_data['id']; $offset = $Posts_num = $Box_Title = ''; if (!empty($cat_data['number'])) { $Posts_num = $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_num . '&offset=' . $offset); ?> <section class="cat-box scroll-box tie-cat-<?php echo $Cat_ID; ?> "> <h2 class="cat-box-title"><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="cat-box-content"> <?php if ($cat_query->have_posts()) { ?> <div class="group_items-box" id="slideshow<?php echo $Cat_ID; ?> "> <?php while ($cat_query->have_posts()) { $cat_query->the_post(); ?> <div 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 the_post_thumbnail('tie-large'); ?> <?php tie_get_score(); ?> </a> </div><!-- post-thumbnail /--> <?php } else { ?> <div class="empty-space"></div> <?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 tie_get_time(); ?> </p> </div> <?php } ?> <div class="clear"></div> </div> <div class="scroll-nav"><a id="next<?php echo $Cat_ID; ?> " href="#"><i class="tieicon-right-open"></i></a><a class="prev-scroll" id="prev<?php echo $Cat_ID; ?> " href="#"><i class="tieicon-left-open"></i></a></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+=3) { vids.slice(i, i+3).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', prev: '#prev<?php echo $Cat_ID; ?> ', next: '#next<?php echo $Cat_ID; ?> ', speed: 300, pause: true }); }); }); </script> <?php }
?> <article class="item-list"> <?php if (function_exists("has_post_thumbnail") && has_post_thumbnail()) { ?> <div class="post-thumbnail single-post-thumb archive-wide-thumb"> <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('slider'); tie_get_score(true); ?> </a> </div> <?php } ?> <h2 class="post-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(); ?>
function get_home_reviews($cat_data) { $Posts = $Box_Title = $order = $rand = ''; if (!empty($cat_data['number'])) { $Posts = $cat_data['number']; } if (!empty($cat_data['order'])) { $order = $cat_data['order']; } if (!empty($cat_data['title'])) { $Box_Title = $cat_data['title']; } if ($order == 'rand') { $orderby = "rand"; } elseif ($order == 'best') { $orderby = "meta_value_num"; } else { $orderby = "date"; } ?> <section class="cat-box cats-review-box"> <h2 class="cat-box-title"><?php if (function_exists('icl_t')) { echo icl_t(theme_name, $cat_data['boxid'], $Box_Title); } else { echo $Box_Title; } ?> </h2> <div class="cat-box-content"> <?php $i = 0; for ($i = 1; $i <= 3; $i++) { $id = 'id' . $i; $Cat_ID = $cat_data[$id]; ?> <div class="reviews-cat"> <h3><a href="<?php echo get_category_link($Cat_ID); ?> "><?php echo get_the_category_by_ID($Cat_ID); ?> </a></h3> <?php $cat_query = new WP_Query(array('posts_per_page' => $Posts, 'meta_key' => 'tie_review_score', 'orderby' => $orderby, 'cat' => $Cat_ID, 'post_status' => 'publish', 'no_found_rows' => 1)); ?> <ul> <?php while ($cat_query->have_posts()) { $cat_query->the_post(); ?> <li><h4><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></h4> <?php tie_get_score(true); ?> </li> <?php } ?> </ul> </div> <?php } ?> </div><!-- .cat-box-content /--> </section> <?php }
?> </a> </div><!-- post-thumbnail /--> <?php } ?> <div class="best-reviews-content"> <h3><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php tie_get_score('large'); ?> <p class="post-meta"> <span><?php _e('Posted by: ', 'tie'); ?> <a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " title="<?php sprintf(esc_attr__('View all posts by %s', 'tie'), get_the_author()); ?> "><?php echo get_the_author(); ?> </a></span>
</a> </div><!-- post-thumbnail /--> <?php } ?> </div> <div class="best-reviews-content"> <h3><a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a></h3> <?php tie_get_score(false, 'large'); ?> <div class="clear"></div> <p class="post-meta"> <span class="post-meta-author"><i class="fa fa-user"></i><a href="<?php echo get_author_posts_url(get_the_author_meta('ID')); ?> " title=""><?php echo get_the_author(); ?> </a></span> <?php tie_get_time(); ?> <span class="post-cats"><i class="fa fa-folder"></i><?php printf('%1$s', get_the_category_list(', '));
<p class="post-meta"> <?php if( tie_get_option( 'arc_meta_score' ) ) tie_get_score(); ?> <?php if( tie_get_option( 'arc_meta_author' ) ): ?> <span class="post-meta-author"><i class="fa fa-user"></i><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) )?>" title=""><?php echo get_the_author() ?> </a></span> <?php endif; ?> <?php if( tie_get_option( 'arc_meta_date' ) ): ?> <?php tie_get_time() ?> <?php endif; ?> <?php if( tie_get_option( 'arc_meta_cats' ) && get_post_type( get_the_ID() ) == 'post' ): ?> <span class="post-cats"><i class="fa fa-folder"></i><?php printf('%1$s', get_the_category_list( ', ' ) ); ?></span> <?php endif; ?> <?php if( tie_get_option( 'arc_meta_comments' ) ): ?> <span class="post-comments"><i class="fa fa-comments"></i><?php comments_popup_link( '0' , '1' , '%' ); ?></span> <?php endif; ?> <?php if( tie_get_option( 'arc_meta_views' ) && get_post_type( get_the_ID() ) == 'post' ): ?> <?php echo tie_views(); ?> <?php endif; ?> </p>