Advertisement
alchymyth

mimbo index custom

Aug 15th, 2011
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.67 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 <= 4 ) {
  38.         //GETS NEXT FOUR EXCERPTS
  39.         ?>
  40.            
  41.         <div class="clearfloat recent-excerpts">
  42.             <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
  43. <?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>
  44.  
  45. <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>
  46.  
  47. <p class="date"><?php the_time('n/d/y'); ?> &bull; </p>
  48.             <?php the_excerpt(); ?>
  49.         </div>
  50.                        
  51. <?php //GETS NEXT HEADLINES
  52.         }
  53. //EDIT STARTS HERE
  54. elseif( $postcount > 4 && $postcount <= 7 ) {
  55. //GETS three narrow EXCERPTS, example only
  56.         ?>
  57.            
  58.         <div class="narrow recent-excerpts <?php echo 'narrow-'.$postcount; ?>">
  59.  
  60. <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>
  61.  
  62. <p class="date"><?php the_time('n/d/y'); ?> &bull; </p>
  63.             <?php the_excerpt(); ?>
  64.         </div>
  65.  
  66. <?php }
  67. //EDIT ENDS HERE
  68.  
  69.         else {
  70.             ob_start();
  71.             echo '<li><a href="';
  72.             the_permalink();
  73.             echo '">';
  74.             the_title();
  75.             echo '</a></li>';
  76.             $links[] = ob_get_contents();
  77.             ob_end_clean();        
  78.         }
  79.         $postcount ++;
  80.         }
  81.     }
  82.     else {
  83. ?>
  84.  
  85. <?php } ?>
  86.    
  87.    
  88. <?php
  89.     if(count($links)): ?>
  90.  
  91.      <h3><?php _e('Older Posts','Mimbo'); ?></h3>
  92.      <ul class="headlines"><?php echo join("\n", $links); ?></ul>
  93.            
  94.     <?php endif; ?>
  95.     </div><!--END RECENT/OLDER POSTS-->
  96.    
  97.    
  98.    
  99.     <div id="featured-cats">
  100.     <h3><?php _e('Featured Categories','Mimbo'); ?></h3>
  101.  
  102.         <?php
  103.         $display_categories = get_option('openbook_cats');
  104.         foreach ($display_categories as $category) {
  105.         $showposts = get_option('openbook_featured_posts');
  106.         query_posts("showposts=$showposts&cat=$category");
  107.         ?>
  108.  
  109. <h5><a href="<?php echo get_category_link($category);?>"><?php single_cat_title(); ?>&raquo;</a></h5>
  110.  
  111.         <ul>
  112.         <?php while (have_posts()) : the_post(); ?>
  113.         <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>
  114.         <?php endwhile; ?>
  115.         </ul>
  116.     <?php } ?>
  117.    
  118. </div><!--END FEATURED CATS-->
  119.  
  120.    
  121. </div><!--END CONTENT-->
  122.  
  123. <?php get_sidebar(); ?>
  124. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement