Advertisement
Guest User

template_blog.php

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