Displaying Excerpts of posts (Bad Formatting)

Discussion in 'WordPress' started by hemanthjava, Oct 11, 2008.

  1. #1
    Hello All,

    I have a question related to Displaying Excerpts of posts in Main Page (Each Page contains 5 Posts) and Achieve Pages...

    Lets go to an Achieve Page by clicking on "September 2008" from the Achieve Section on the right. (For Example: http://www.iwebie.com/2008/10)

    If you see the Excerpts displayed for each of the posts, they are all displayed randomly. Somehow all the images have got automatically trimmed off and the excerpts are formatted very UGLY(All the formatting is lost). How do I have better control over it.

    Code for Achieve.php is as shown below

    
    <?php get_header(); ?>
    
    <?php include (TEMPLATEPATH . "/sidebar1.php"); ?>	
    
    		<div id="content">
    
    		<?php if (have_posts()) : ?>
    
    		 <?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
    <?php /* If this is a category archive */ if (is_category()) { ?>
    				
    <h2 class="sectionhead">Category: <?php echo single_cat_title(); ?></h2>
    		
    <?php /* If this is a daily archive */ } elseif (is_day()) { ?>
    <h2 class="sectionhead">Archive for <?php the_time('F jS, Y'); ?></h2>
    		
    <?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
    <h2 class="sectionhead">Archive for <?php the_time('F, Y'); ?></h2>
    
    <?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
    <h2 class="sectionhead">Archive for <?php the_time('Y'); ?></h2>
    		
    <?php /* If this is a search */ } elseif (is_search()) { ?>
    <h2 class="sectionhead">Search Results</h2>
    		
    <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    <h2 class="sectionhead">Author Archive</h2>
    
    <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
    <h2 class="sectionhead">Blog Archives</h2>
    
    		<?php } ?>
    
    <?php while (have_posts()) : the_post(); ?>
    
    			
    				<div class="post" id="post-<?php the_ID(); ?>">
    
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?> &raquo;</a></h2>
    
    					<p class="postinfo">By <?php the_author_posts_link(); ?> on <?php the_time('M j, Y') ?> in <?php the_category(', ') ?> | <?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?><?php edit_post_link('Edit', ' | ', ''); ?></p>
    			
    					<div class="entry">
    						<?php the_excerpt(); ?>
    					</div>
    				</div>        
    
    <?php endwhile; endif; ?>
    
    				<div class="navigation">
    					<div class="alignright">
    		<?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
    					</div>
    	               		</div>
    
                    </div>
    
    		</div>
    
    <?php get_sidebar(); ?>
    
    	</div>
    
    <?php get_footer(); ?>
    
    Code (markup):
    There is no Read More Link also..

    Please help me to make the Archive's look Attractive and better so that I can use them in the main posts page too.
     
    hemanthjava, Oct 11, 2008 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Yes, the excerpt function is not very useful. There are a few plugins that can help:
    Advanced Excerpt Plugin
    Excerpt Editor Plugin

    If you just want to add a "Read More" link, try this:
    
    <div class="entry">
       <?php the_excerpt(); ?>
       <a href="<?php the_permalink() ?>">Read More</a>
    </div>
    
    Code (markup):
     
    Cash Nebula, Oct 11, 2008 IP
  3. hemanthjava

    hemanthjava Well-Known Member

    Messages:
    1,258
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    160
    #3
    I installed the Advanced Excerpt Plugin as suggested by you and used the Default Plugin Settings after Activation. You can take a look at the page now

    http://www.iwebie.com/2008/10

    Bugs;

    1. There is no Read More Link After each Excerpt.
    2. The formatting gets Screwed 2 Excerpts. Sometimes there is more than One line space between 2 Posts. Sometimes there are no spaces between 2 posts at all.

    Example: Between "Work From Home Jobs" and "Free Online Pacman Game" Articles.

    Note: I disabled the Sociable Plugin as it started appearing Twice for Certain Posts

    Thanks in Advance. Please help me
     
    hemanthjava, Oct 11, 2008 IP
  4. mizaks

    mizaks Well-Known Member

    Messages:
    2,066
    Likes Received:
    126
    Best Answers:
    0
    Trophy Points:
    135
    #4
    mizaks, Oct 12, 2008 IP