Advertisement
alchymyth

mimbo index custom

Aug 15th, 2011
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.80 KB | None | 0 0
  1. <?php get_header(); ?>
  2.  
  3. <?php if (have_posts()) { ?>
  4.  
  5. <div id="content">
  6.  
  7.  <?php
  8.     $postCount = 0;
  9.     $page = (get_query_var('paged')) ? get_query_var('paged') : 1;
  10.     query_posts( 'paged=$page&post_per_page=-1&cat=' . get_query_var('cat') );
  11.     while (have_posts()) { the_post();
  12.         if( $postcount == 0 ) {
  13.         //GETS LATEST OR STICKY POST
  14.     ?>
  15.            
  16.     <div id="lead" class="clearfloat">
  17.              
  18.             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  19. <?php echo get_post_image (get_the_id(), '', '', '' .get_bloginfo('template_url') .'/scripts/timthumb.php?zc=1&amp;w=260&amp;h=230&amp;src='); ?></a>
  20.    
  21.     <div id="lead-text">
  22.     <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  23.     <?php the_title(); ?></a> <span class="commentcount"> (<?php comments_popup_link('0', '1', '%'); ?>)</span></h2>
  24.    
  25.    
  26.     <p class="date"><?php the_time('n/d/y'); ?> &bull; </p>
  27.     <?php the_excerpt(); ?>
  28.     </div>
  29.             </div><!--END LEAD/STICKY POST-->
  30.            
  31.        
  32.         <div id="more-posts">
  33.         <h3><?php _e('Recent Posts','Mimbo'); ?></h3>
  34.        
  35.         <?php
  36.         }
  37.         elseif( $postcount > 0 && $postcount <= 30 ) {
  38.         //GETS NEXT FOUR EXCERPTS
  39.         ?>
  40.  
  41. //MAIN EDIT STARTS HERE
  42. if( $postcount > 4 && $postcount <= 7 ) {
  43. //GETS three narrow EXCERPTS, example only
  44.         ?>
  45.            
  46.         <div class="narrow recent-excerpts <?php echo 'narrow-'.$postcount; ?>">
  47.  
  48. <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <span class="commentcount">(<?php comments_popup_link('0', '1', '%'); ?>)</span></h4>
  49.  
  50. <p class="date"><?php the_time('n/d/y'); ?> &bull; </p>
  51.             <?php the_excerpt(); ?>
  52.         </div>
  53.  
  54. <?php }
  55. else {
  56. //MAIN EDIT ENDS HERE (there is more edit to close the if/else later)
  57.            
  58.         <div class="clearfloat recent-excerpts">
  59.             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  60. <?php echo get_post_image (get_the_id(), '', '', '' .get_bloginfo('template_url') .'/scripts/timthumb.php?zc=1&amp;w=105&amp;h=85&amp;src='); ?></a>
  61.  
  62. <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <span class="commentcount">(<?php comments_popup_link('0', '1', '%'); ?>)</span></h4>
  63.  
  64. <p class="date"><?php the_time('n/d/y'); ?> &bull; </p>
  65.             <?php the_excerpt(); ?>
  66.         </div>
  67.  
  68. //EDIT TO CLOSE THE IF ELSE FROM MAIN EDIT
  69. <?php } ?>
  70. //END OF EDIT
  71.                        
  72. <?php //GETS NEXT HEADLINES
  73.         }
  74.  
  75.  
  76.         else {
  77.             ob_start();
  78.             echo '<li><a href="';
  79.             the_permalink();
  80.             echo '">';
  81.             the_title();
  82.             echo '</a></li>';
  83.             $links[] = ob_get_contents();
  84.             ob_end_clean();        
  85.         }
  86.         $postcount ++;
  87.         }
  88.     }
  89.     else {
  90. ?>
  91.  
  92. <?php } ?>
  93.    
  94.    
  95. <?php
  96.     if(count($links)): ?>
  97.  
  98.      <h3><?php _e('Older Posts','Mimbo'); ?></h3>
  99.      <ul class="headlines"><?php echo join("\n", $links); ?></ul>
  100.            
  101.     <?php endif; ?>
  102.     </div><!--END RECENT/OLDER POSTS-->
  103.    
  104.    
  105.    
  106.     <div id="featured-cats">
  107.     <h3><?php _e('Featured Categories','Mimbo'); ?></h3>
  108.  
  109.         <?php
  110.         $display_categories = get_option('openbook_cats');
  111.         foreach ($display_categories as $category) {
  112.         $showposts = get_option('openbook_featured_posts');
  113.         query_posts("showposts=$showposts&cat=$category");
  114.         ?>
  115.  
  116. <h5><a href="<?php echo get_category_link($category);?>"><?php single_cat_title(); ?>&raquo;</a></h5>
  117.  
  118.         <ul>
  119.         <?php while (have_posts()) : the_post(); ?>
  120.         <li class="clearfloat"><p class="date"><?php the_time('n/d/y'); ?> &bull; </p><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></li>
  121.         <?php endwhile; ?>
  122.         </ul>
  123.     <?php } ?>
  124.    
  125. </div><!--END FEATURED CATS-->
  126.  
  127.    
  128. </div><!--END CONTENT-->
  129.  
  130. <?php get_sidebar(); ?>
  131. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement