Forums

Excerpt (2 posts)

  1. shaigan
    Member
    Posted 2 years ago #

    Hi,

    I'm using a free wordpress theme I downloaded (Glory Theme), I'd like to have post excerpts on the homepage rather than full posts, here's the code, if anyone can help me manipulate it I'd gladly appreciate it!

    This is the index.php code

    <?php get_header(); ?>
    
    <div id="content">
    
    <a href="http://facebook.com/mycaribbeanislandboy" title="Follow Me" target="blank">
    		<img src="<?php bloginfo('template_directory'); ?>/images/facebook.png" alt="picture" id="facebook"/>
    		</a>
    
    	<a href="<?php bloginfo('rss2_url'); ?>" title="RSS Feed for all Posts" class="feedlink"><img src="<?php bloginfo('template_directory'); ?>/images/rss.jpg" alt="picture" id="rss"/></a>
    
    	<?php
    	$twitter_username = get_option('_twitter_username');
    	if (!empty($twitter_username)) {
    	?>
    		<a href="http://twitter.com/<?php echo $twitter_username; ?>" title="Follow Us" target="blank">
    		<img src="<?php bloginfo('template_directory'); ?>/images/twitter.png" alt="picture" id="twit-icon"/>
    		</a>
    	<?php
    	}
    	?>
    
    	<?php get_sidebar(); ?>
    
    <?php if(is_home() && $post==$posts[0] && !is_paged()) { ?>
    <?php include (TEMPLATEPATH . '/featured_posts_slideshow.php'); ?>
    <?php } ?>
    
    <div id="maincol-a">
    <div id="maincol-b">
    <div id="maincol-c">
    
    	<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	<?php if (in_category($featcat)) continue; ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    	<div class="entry">
    
    		<div class="meta">
    			<span class="date"><?php the_time('F j, Y'); ?></span>
    			<span class="label"><?php the_category(', ') ?></span>
    			<span class="comment-count">  <?php comments_popup_link('0 Comments', '1 Comments', '% Comments'); ?></span>
    		</div>
    
    		<div class="post-title">
    			<h3><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h3>
    		</div>
    
    	<?php the_content(''); ?>
    	<?php link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', ''), "</div>\n", 'number'); ?>	
    
    	</div>
    	</div><!--/post -->
    
    <?php endwhile; ?>
    <?php else : ?>
    
    <h3 class="nothing">Sorry, the file is no longer available</h3>
    <?php endif; ?>
    
    	<div id="navigation">
    		<?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?>
    	</div>
    
    	</div><!-- #maincol-c -->
    	</div><!-- #maincol-b -->
    	</div><!-- #maincol-a -->
    	</div><!-- #content-->
    
    <?php get_footer(); ?>

    Thanks again!

  2. Tara
    Member
    Posted 2 years ago #

    Have you tried:

    replacing <?php the_content(''); ?>

    with <?php the_excerpt(); ?>

    Documentation: http://codex.wordpress.org/Function_Reference/the_excerpt

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags