function arras_add_slideshow() { global $post_blacklist; if (!is_home()) { return false; } $slideshow_cat = arras_get_option('slideshow_cat'); if (arras_get_option('enable_slideshow') == false) { return false; } $query = arras_parse_query($slideshow_cat, arras_get_option('slideshow_count'), array_unique($post_blacklist), arras_get_option('slideshow_posttype'), arras_get_option('slideshow_tax')); $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 } }
<?php if (arras_get_option('enable_news')) { arras_above_index_news_post(); ?> <!-- News Articles --> <div id="index-news"> <?php if (arras_get_option('news_title') != '') { ?> <div class="home-title"><?php _e(arras_get_option('news_title')); ?> </div> <?php } $news_query = arras_parse_query($news_cat, arras_get_option('index_count') == 0 ? get_option('posts_per_page') : arras_get_option('index_count'), array_unique($post_blacklist), arras_get_option('news_posttype'), arras_get_option('news_tax')); $news_query['paged'] = $paged; query_posts(apply_filters('arras_news_query', $news_query)); arras_render_posts(null, arras_get_option('news_display'), arras_get_option('news_tax')); 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 widget($args, $instance) { global $wpdb; extract($args, EXTR_SKIP); if ($instance['no_display_in_home'] && is_home()) { return false; } $title = apply_filters('widget_title', $instance['title']); echo $before_widget; echo $before_title . $title . $after_title; $q = arras_parse_query($instance['featured_cat'], $instance['postcount']); $r = new WP_Query($q); if ($r->have_posts()) { echo '<ul class="featured-stories">'; while ($r->have_posts()) { $r->the_post(); ?> <li class="clearfix"> <?php if (isset($instance['show_thumbs'])) { ?> <div class="thumb"><?php echo arras_get_thumbnail('sidebar-thumb', get_the_ID()); ?> </div><?php } ?> <div class="featured-stories-summary"> <a href="<?php the_permalink(); ?> "><?php the_title(); ?> </a><br /> <span class="sub"><?php the_time(__('d F Y g:i A', 'arras')); ?> | <?php comments_number(__('No Comments', 'arras'), __('1 Comment', 'arras'), __('% Comments', 'arras')); ?> </span> <?php if ($instance['show_excerpts']) { ?> <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 } ?> </div> </li> <?php } echo '</ul>'; } echo $after_widget; }