Index.php...How to amend posts display on the home page?

Discussion in 'PHP' started by bigtugboat, Apr 3, 2010.

  1. #1
    On the home page of my blog, posts are appearing this way:
    First post appears in full, second through fifth posts are appearing as excerpts. Beyond that the problem starts: from sixth posts onwards, only post titles are appearing.

    I want to get rid of this "post titles only" thing. Please help me know what to tweak in the following index.php file so that the posts following the fifth one should also appear as excerpts instead of just post titles.

    Home page of the blog.

    Index.php:

    <?php get_header(); ?>
    <?php get_sidebar(); ?>
    
    <div id="main-content">
    
    	<div id="content">
    <img src="http://www.ahmedirfanshafqat.com/wp-content/uploads/random/rotate.php" alt="" width="565" height="325" />
    	<?php if($paged < 2) 
    			{  ?>
    			
    			<?php $count = 1 ?>
      
      	<?php while (have_posts()) : the_post(); ?>
    		
    		
    		<?php if($count==1) { ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    	  <div class="entry">
            <center><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?> Permanent Link: "><?php the_title(); ?></a></h5></center>
    		<span class="post-calendar"><?php if (get_the_author_url()) { ?><a href="<?php the_author_url(); ?>"><?php the_author(); ?></a><?php } else { the_author(); } ?> نے  <?php the_time('l، j F Y') ?> کو شائع کیا.</span>
    	  </div>
    		<div class="post-content">
    			<?php the_content('جاری رکھیے۔۔۔ &raquo;'); ?>
    		</div>
    		
    		<div class="post-info">
    			<span class="post-cat"><?php the_category('، ') ?></span> <span class="post-comments"><?php comments_popup_link('تبصرہ کریں »', '1 تبصرہ »', '% تبصرے »'); ?></span>
    		</div>
    		
    		<br>
    
    	<div id="tag">ٹیگز 
    <br>
    <?php the_tags(' ' , ' , ' , ' '); ?>
    	</div>	
    
    		<?php } ?>
    		
    				
    		<?php if($count>1 && $count<6) { ?>
    		
        <div class="post" id="post-<?php the_ID(); ?>">
    		<div class="entry">
            <center><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?> Permanent Link: "><?php the_title(); ?></a></h5></center>
    		<span class="post-calendar"><?php if (get_the_author_url()) { ?><a href="<?php the_author_url(); ?>"><?php the_author(); ?></a><?php } else { the_author(); } ?> نے  <?php the_time('l، j F Y') ?> کو شائع کیا.</span>
    		</div>
    		
    		
    		<div class="post-content">
    			<?php if(get_post_meta($post->ID, "Thumbnail", false)) { ?>
    				<a href="<?php the_permalink(); ?>"><img src="<?php echo get_post_meta($post->ID, "Thumbnail", true); ?>" alt="<?php the_title(); ?> <?php _e('thumbnail'); ?>" class="alignleft" /></a>
    			<?php } ?>
    						
    			<?php the_excerpt(); ?>
    			<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>">مکمل تحریر پڑھیے »</a></p>
    		</div>
    				
    				<div class="post-info">
    			<span class="post-cat"><?php the_category('، ') ?></span> <span class="post-comments"><?php comments_popup_link('تبصرہ کریں »', '1 تبصرہ »', '% تبصرے »'); ?></span>
    				</div>
    				
    <br>
    
    	<div id="tag">ٹیگز 
    <br>
    <?php the_tags(' ' , ' , ' , ' '); ?>
    	</div>	
    		
    		<?php } ?>
    		
    			
    			
    			<?php if($count>5) { ?>
    	<div class="post" id="post-<?php the_ID(); ?>">
    		<div class="entry">
            <center><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?> Permanent Link: "><?php the_title(); ?></a></h5></center>
    		<span class="post-calendar"><?php if (get_the_author_url()) { ?><a href="<?php the_author_url(); ?>"><?php the_author(); ?></a><?php } else { the_author(); } ?> نے  <?php the_time('l، j F Y') ?> کو شائع کیا.</span>
    		</div>
    			<?php } ?>
    	</div>
    	<?php $count = $count + 1; ?>
    	<?php endwhile; ?>
    			
    	  <?php } 
    	
    			
    			else { ?>
    					
    					<?php while (have_posts()) : the_post(); ?>
    			
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<div class="entry">
    				<center><h5><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?> Permanent Link: "><?php the_title(); ?></a></h5></center>
    				<span class="post-calendar"><?php if (get_the_author_url()) { ?><a href="<?php the_author_url(); ?>"><?php the_author(); ?></a><?php } else { the_author(); } ?> نے  <?php the_time('l، j F Y') ?> کو شائع کیا.</span>
    				</div>
    			</div>
    		<?php endwhile; ?>
    					
    			<?php } ?>
    
    		<div class="navigation">
    			<span class="previous-entries"><?php next_posts_link('اگلا صفحہ') ?></span> <span class="next-entries"><?php previous_posts_link('پچھلا صفحہ') ?></span>
    		</div>
    	
    			
    	</div>
    		
    <?php include("left-sidebar.php");?>
    		
    </div>
    
    <?php get_footer();?>
    Code (markup):
     
    bigtugboat, Apr 3, 2010 IP