?> <!-- News Articles --> <div id="index-news"> <?php if (arras_get_option('news_title') != '') { ?> <h2 class="home-title"><?php _e(arras_get_option('news_title')); ?> </h2> <?php } ?> <?php $news_query_args = apply_filters('arras_news_query', array('list' => $news_cat, 'taxonomy' => arras_get_option('news_tax'), 'query' => array('posts_per_page' => arras_get_option('news_count'), 'exclude' => $post_blacklist, 'post_type' => arras_get_option('news_posttype'), 'paged' => $paged))); $news_query = arras_prep_query($news_query_args); query_posts($news_query); $news_display = arras_get_option('news_display') ? arras_get_option('news_display') : 'default'; arras_featured_loop($news_display, $news_query_args, true); if (function_exists('wp_pagenavi')) { wp_pagenavi(); } else { ?> <div class="navigation clearfix"> <div class="floatleft"><?php next_posts_link(__('Older Entries', 'arras')); ?> </div> <div class="floatright"><?php previous_posts_link(__('Newer Entries', 'arras')); ?>
function arras_widgets_post_loop($id, $args = array()) { global $wp_query, $post; $_defaults = array('taxonomy' => 'category', 'show_thumbs' => true, 'show_excerpt' => true, 'query' => array('post_type' => 'post', 'posts_per_page' => 5, 'orderby' => 'date', 'order' => 'DESC')); $args['query'] = wp_parse_args($args['query'], $_defaults['query']); $args = wp_parse_args($args, $_defaults); $q = new WP_Query(arras_prep_query($args)); if ($q->have_posts()) { echo '<ul class="' . $id . '">'; while ($q->have_posts()) { $q->the_post(); // hack for plugin authors who love to use $post = $wp_query->post $wp_query->post = $q->post; setup_postdata($post); ?> <li class="clearfix"> <?php if ($args['show_thumbs']) { echo '<a rel="bookmark" href="' . get_permalink() . '" class="thumb">' . arras_get_thumbnail('sidebar-thumb', get_the_ID()) . '</a>'; } ?> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a><br /> <span class="sub"><?php printf(__('Posted %s', 'arras'), arras_posted_on(false)); ?> | <a href="<?php comments_link(); ?> "><?php comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras')); ?> </a> </span> <?php if ($args['show_excerpt']) { ?> <p class="excerpt"> <?php echo get_the_excerpt(); ?> </p> <a class="sidebar-read-more" href="<?php the_permalink(); ?> "><?php _e('Read More', 'arras'); ?> </a> <?php } ?> </li> <?php } echo '</ul>'; } else { echo '<span class="textCenter sub">' . __('No posts at the moment. Check back again later!', 'arras') . '</span>'; } wp_reset_query(); }
function arras_featured_loop($display_type = 'default', $arras_args = array(), $query_posts = false) { global $wp_query; if ($query_posts) { $q = $wp_query; } else { $arras_args = arras_prep_query($arras_args); $q = new WP_Query($arras_args); } if ($q->have_posts()) { if (!isset($arras_args['taxonomy'])) { $arras_args['taxonomy'] = 'category'; } arras_get_tapestry_callback($display_type, $q, $arras_args['taxonomy']); } wp_reset_query(); }
function arras_add_slideshow() { global $post_blacklist, $paged; if (!is_home() || $paged) { return false; } $slideshow_cat = arras_get_option('slideshow_cat'); if (arras_get_option('enable_slideshow') == false) { return false; } $query = arras_prep_query(array('list' => $slideshow_cat, 'taxonomy' => arras_get_option('slideshow_tax'), 'query' => array('posts_per_page' => arras_get_option('slideshow_count'), 'exclude' => $post_blacklist, 'post_type' => arras_get_option('slideshow_posttype'), 'paged' => $paged))); $q = new WP_Query(apply_filters('arras_slideshow_query', $query)); if ($q->have_posts()) { ?> <!-- Featured Slideshow --> <div class="featured clearfix"> <?php if ($q->post_count > 1) { ?> <div id="controls"> <a href="" class="prev"><?php _e('Prev', 'arras'); ?> </a> <a href="" class="next"><?php _e('Next', 'arras'); ?> </a> </div> <?php } ?> <div id="featured-slideshow"> <?php $count = 0; ?> <?php while ($q->have_posts()) { $q->the_post(); ?> <div class="featured-slideshow-inner" <?php if ($count != 0) { echo 'style="display: none"'; } ?> > <a class="featured-article" href="<?php the_permalink(); ?> " rel="bookmark"> <?php echo arras_get_thumbnail('featured-slideshow-thumb'); ?> </a> <div class="featured-entry"> <a class="entry-title" href="<?php the_permalink(); ?> " rel="bookmark"><?php the_title(); ?> </a> <div class="entry-summary"><?php the_excerpt(); ?> </div> <div class="progress"></div> </div> </div> <?php arras_blacklist_duplicates(); // required for duplicate posts function to work. $count++; } ?> </div> </div> <?php } }
function arras_add_slideshow() { global $post_blacklist, $paged; if (!is_home() || $paged) { return false; } // if we're not on the first page of the homepage, quit if (false === arras_get_option('enable_slideshow')) { return false; } // if the slideshow option is disabled, quit $slideshow_cat = arras_get_option('slideshow_cat'); $query = arras_prep_query(array('list' => $slideshow_cat, 'taxonomy' => arras_get_option('slideshow_tax'), 'query' => array('posts_per_page' => arras_get_option('slideshow_count'), 'exclude' => $post_blacklist, 'post_type' => arras_get_option('slideshow_posttype'), 'paged' => $paged))); $q = new WP_Query(apply_filters('arras_slideshow_query', $query)); if ($q->have_posts()) { ?> <!-- Featured Slideshow --> <div class="featured group"> <div id="controls" class="slide-controls"> <div class="cycle-prev"><?php _e('Prev', 'arras'); ?> </div> <div class="cycle-next"><?php _e('Next', 'arras'); ?> </div> </div> <div id="featured-slideshow" class="cycle-slideshow" data-cycle-slides='> a' data-cycle-swipe=true data-cycle-swipe-fx=scrollHorz data-cycle-speed=1000 data-cycle-prev=".cycle-prev" data-cycle-next=".cycle-next" data-cycle-auto-height="16:9" data-cycle-caption-plugin="caption2" data-cycle-overlay-template="<a href={{link}}><h3 class=entry-title>{{title}}</h3><div class=entry-summary>{{excerpt}}</div>"> <?php $count = 0; ?> <div class="cycle-overlay custom"></div> <?php while ($q->have_posts()) { $q->the_post(); ?> <?php echo arras_make_slide(); ?> <?php arras_blacklist_duplicates(); // required for duplicate posts function to work. ?> <?php $count++; } ?> </div> </div> <?php } }