Advertisement
Guest User

Untitled

a guest
Mar 11th, 2011
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.05 KB | None | 0 0
  1.       <?php if (have_posts()) : $count = 0; ?>
  2.        
  3.             <?php if (is_category()) { ?>
  4.             <span class="archive_header"><span class="fl cat"><?php _e('Archive', 'woothemes'); ?> | <?php echo single_cat_title(); ?></span> <span class="fr catrss"><?php $cat_obj = $wp_query->get_queried_object(); $cat_id = $cat_obj->cat_ID; echo '<a href="'; get_category_rss_link(true, $cat, ''); echo '">RSS feed for this section</a>'; ?></span></span>        
  5.        
  6.             <?php } elseif (is_day()) { ?>
  7.             <span class="archive_header"><?php _e('Archive', 'woothemes'); ?> | <?php the_time($GLOBALS['woodate']); ?></span>
  8.  
  9.             <?php } elseif (is_month()) { ?>
  10.             <span class="archive_header"><?php _e('Archive', 'woothemes'); ?> | <?php the_time('F, Y'); ?></span>
  11.  
  12.             <?php } elseif (is_year()) { ?>
  13.             <span class="archive_header"><?php _e('Archive', 'woothemes'); ?> | <?php the_time('Y'); ?></span>
  14.  
  15.             <?php } elseif (is_author()) { ?>
  16.             <span class="archive_header"><?php _e('Archive by Author', 'woothemes'); ?></span>
  17.  
  18.             <?php } elseif (is_tag()) { ?>
  19.             <span class="archive_header"><?php _e('Tag Archives:', 'woothemes'); ?> <?php echo single_tag_title('', true); ?></span>
  20.            
  21.             <?php } ?>
  22.            
  23.             <div class="fix"></div>
  24.  
  25.             <!--YOUR CODE STARTS HERE -->
  26.  
  27.             <div id="featured-category"><!--Container here, only suppose to show 1 post -->
  28.             <?php
  29.             $count = 0;
  30.             while ( have_posts() ) : the_post(); ?>
  31.             <?php if ( 1 < $count ) { ?>
  32.            
  33.             <div class="heading">
  34.             <h2 class="recent-post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  35.             </div>
  36.              
  37.             <div class="FC-image">
  38.             <?php $id = get_the_ID(); ?>
  39.             <?php $image_meta = get_post_meta($id,'image',true); ?>
  40.                
  41.             <?php if ( (isset($image_meta)) && ($image_meta != '') ) {
  42.             woo_image('key=image&width=300&height=' . $large_thumb_h);
  43.             }else{
  44.             echo $large_placeholder;
  45.             }?>
  46.             </div><!-- /FC-image -->
  47.            
  48.             </div><!-- /Featured Category end of container here -->
  49.                
  50.             <!--Break here -->    
  51.                
  52.                
  53.             <div id="recent-posts"><!--Container 2 here suppose to show 3 post with a different layout then above -->
  54.            <?php } elseif ( 3 < $count ) { ?>
  55.             <!-- Post Starts -->
  56.             <div class="post">
  57.             <?php $id = get_the_ID(); ?>
  58.             <?php $image_meta = get_post_meta($id,'image',true); ?>
  59.                                
  60.             <div class="post-img">
  61.             <?php if ( (isset($image_meta)) && ($image_meta != '') ) {
  62.             woo_image('key=image&width=100&height=80');
  63.             }else{
  64.             echo $large_placeholder;                       
  65.             }  
  66.             ?>     
  67.             </div>
  68.            
  69.             <div class="heading">
  70.             <h2 class="recent-post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  71.             </div>
  72.            
  73.             <div class="recent-post-content">      
  74.             <?php get_the_excerpt_limit( 200, '...&nbsp;Read More&nbsp;&raquo;' ); ?>                  
  75.             </div><!-- /.heading -->               
  76.             </div><!-- /.post -->
  77.            
  78.             <?php } else { ?>
  79.            
  80.             <div class="post"><!--no container here but suppose to show the remaining post with a different layout then above -->
  81.             <div class="heading">
  82.             <h2 class="recent-post-title"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
  83.             </div>
  84.            
  85.             <div class="recent-post-content two">
  86.             <?php get_the_excerpt_limit( 200, '...&nbsp;Read More&nbsp;&raquo;' ); ?>                  
  87.             </div><!-- /.heading -->
  88.            
  89.             </div><!-- /.post -->
  90.              <?php } ?>
  91.            
  92.             <? $count++; endwhile; ?> <!-- Code ends here -->
  93.  
  94.             <div class="fix"></div>
  95.        
  96.         </div><!-- /#recent-posts end of container -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement