Advertisement
Guest User

Newscast - Index

a guest
May 24th, 2013
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.76 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3.  
  4. <?php
  5. // FRONTPAGE SLIDESHOW
  6. //
  7. // check if slideshow should be displayed?
  8. if($k_option['mainpage']['slider'] != 'none') :
  9. ?>
  10. <!-- FEATURED POST AREA ################################################### -->
  11. <div id="feature_wrap">
  12. <!-- ###################################################################### -->
  13. <div id="featured" class='<?php echo $k_option['mainpage']['slider']; ?>'>
  14.  
  15. <?php
  16.  
  17. //check slider and apply size to previe images
  18. $kimg = array('shortcut' => 'L', 'overwrite' => 'none');
  19.  
  20. if($k_option['mainpage']['slider'] == 'fadeslider')
  21. {
  22. $kimg = array('shortcut' => 'XL', 'overwrite' => 'none');
  23. }
  24.  
  25. // start the loop that gernerates the images
  26. $loopcount = 1;
  27. $additional_loop = new WP_Query("cat=".$k_option['mainpage']['feature_cats_final']."&posts_per_page=".$k_option['mainpage']['feature_count']);
  28. if ($additional_loop->have_posts()) :
  29. while ($additional_loop->have_posts()) : $additional_loop->the_post();
  30.  
  31.  
  32.  
  33. $preview_image = kriesi_post_thumb($post->ID, array('size'=> array($kimg['shortcut'],$kimg['overwrite']),
  34. 'display_link' => array('none'),
  35. 'wh' => $k_option['custom']['imgSize'][$kimg['shortcut']]
  36. ));
  37.  
  38. // Featured Entry:
  39. ?>
  40. <div class="featured featured<?php echo $loopcount; ?>">
  41. <a href="<?php the_permalink(); ?>">
  42. <span class='feature_excerpt'>
  43. <strong class='sliderheading'><?php the_title(); ?></strong>
  44. <span class='sliderdate'><?php the_time('M d, Y') ?></span>
  45. <span class='slidercontent'>
  46. <?php
  47. $content = strip_tags(get_the_excerpt(),'<a><strong><span>');
  48. echo $content;
  49. ?>
  50. </span>
  51. </span>
  52. <?php echo $preview_image; ?>
  53. </a>
  54. </div>
  55. <?php
  56. // end entry
  57.  
  58. $loopcount ++;
  59. endwhile; endif;
  60. ?>
  61.  
  62. </div><!-- end #featured -->
  63.  
  64. <span class='bottom_right_rounded_corner ie6fix'></span>
  65. <span class='bottom_left_rounded_corner ie6fix'></span>
  66.  
  67. <!-- ###################################################################### -->
  68. </div><!-- end featuredwrap -->
  69. <!-- ###################################################################### -->
  70. <?php endif; // end slideshow ?>
  71.  
  72.  
  73. <!-- ###################################################################### -->
  74. <div id="main">
  75. <!-- ###################################################################### -->
  76.  
  77. <div id="content">
  78. <?php
  79.  
  80. $fullsized = $k_option['general']['article_appearance'];
  81. if($paged >= 2)
  82. {
  83. if($k_option['general']['article_appearance_sub'] == 1) $fullsized = 0;
  84. if($k_option['general']['article_appearance_sub'] == 2) $fullsized = 10000;
  85. if($k_option['general']['article_appearance_sub'] == 3) $fullsized = $k_option['general']['article_appearance'];;
  86. }
  87.  
  88.  
  89. $negative_cats = preg_replace("!(\d)+!","-${0}$0", $k_option['mainpage']['main_cat_final']);
  90. $smallsized = 1;
  91.  
  92. $additional_loop = new WP_Query("cat=".$negative_cats."&paged=$paged");
  93.  
  94. if ($additional_loop->have_posts()) :
  95. while ($additional_loop->have_posts()) : $additional_loop->the_post();
  96.  
  97. // ############################# FULL SIZED POSTS #############################
  98. if (1 > 0) :
  99.  
  100. $preview_image = kriesi_post_thumb($post->ID, array('size'=> array('M'),
  101. 'display_link' => '_prev_image_link',
  102. 'linkurl' => array ('L','_preview_big'),
  103. 'wh' => $k_option['custom']['imgSize']['M']
  104. ));
  105.  
  106.  
  107. ?>
  108. <div class="entry <?php if(!$preview_image) echo 'entry-no-pic';?>">
  109. <?php
  110. if($preview_image)
  111. {
  112. echo '<div class="entry-previewimage rounded preloading_background">';
  113. echo $preview_image;
  114. echo '</div>';
  115. }
  116.  
  117. ?>
  118.  
  119. <div class="entry-content">
  120. <h1 class="entry-heading">
  121. <a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:','newscast')?> <?php the_title(); ?>">
  122. <?php the_title(); ?>
  123. </a>
  124. </h1>
  125.  
  126. <div class="entry-head">
  127. <span class="date ie6fix"><?php the_time('M d, Y') ?></span>
  128. <span class="comments ie6fix"><?php comments_popup_link(__('No Comments','newscast'), __('1 Comment','newscast'), __('% Comments','newscast')); ?></span>
  129. <span class="author ie6fix"><?php _e('by','newscast');?> <?php the_author_posts_link(); ?></span>
  130. </div>
  131.  
  132. <div class="entry-text">
  133. <?php the_excerpt() ?>
  134. </div>
  135.  
  136. <div class="entry-bottom">
  137. <span class="categories"><?php the_category(', '); ?></span>
  138. <a href="<?php echo get_permalink() ?>" class="more-link"><?php _e('Read more','newscast'); ?></a>
  139. </div>
  140. </div><!--end entry_content-->
  141. </div><!--end entry -->
  142. <?php
  143. $fullsized--;
  144.  
  145. else:
  146. // ############################# SMALL SIZED POSTS #############################
  147. if($smallsized == 1): echo '<div class="doubleentry">'; endif;
  148. $smallsized ++;
  149.  
  150. $small_prev = kriesi_post_thumb($post->ID, array('size'=> array('S'),
  151. 'display_link' => '_prev_image_link',
  152. 'linkurl' => array ('L','_preview_big'),
  153. 'wh' => $k_option['custom']['imgSize']['S'],
  154. 'img_attr' => array('class'=>'rounded alignleft'),
  155. 'link_attr' => array('class'=>'alignleft preloading_background')
  156. ));
  157.  
  158. ?>
  159. <div class="entry">
  160. <div class="entry-content">
  161. <h1 class="entry-heading">
  162. <a href="<?php echo get_permalink() ?>" rel="bookmark" title="<?php _e('Permanent Link:','newscast')?> <?php the_title(); ?>">
  163. <?php the_title(); ?>
  164. </a>
  165. </h1> <div class="entry-head">
  166. <span class="date ie6fix"><?php the_time('M d, Y') ?></span>
  167. <span class="comments ie6fix"><?php comments_popup_link(__('No Comments','newscast'), __('1 Comment','newscast'), __('% Comments','newscast')); ?></span>
  168. </div>
  169.  
  170. <div class="entry-text">
  171. <?php
  172. if($small_prev) echo $small_prev;
  173. the_excerpt();
  174. ?>
  175. </div>
  176.  
  177. <div class="entry-bottom">
  178. <a href="<?php echo get_permalink() ?>" class="more-link"><?php _e('Read more','newscast'); ?></a>
  179. </div>
  180. </div>
  181. </div>
  182.  
  183. <?php
  184. if($smallsized > 2): echo '</div>'; $smallsized = 1; endif;
  185.  
  186. endif; endwhile;
  187. if($smallsized == 2):echo '</div>'; endif;
  188.  
  189. kriesi_pagination($additional_loop->max_num_pages);
  190.  
  191. else:
  192.  
  193. echo'<div class="entry">';
  194. echo'<h2>'.__('Nothing Found','newscast').'</h2>';
  195. echo'<p>'.__('Sorry, no posts matched your criteria','newscast').'</p>';
  196. echo'</div>';
  197.  
  198. endif;
  199.  
  200. // end content: ?></div>
  201.  
  202. <?php
  203. get_sidebar();
  204.  
  205. get_footer();
  206. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement