WordPress.org

Forums

[resolved] Read More functionality (3 posts)

  1. Bryan Hoffman
    Member
    Posted 6 years ago #

    I have a site where I use a 'home' page as the main landing page rather than the main blog page... I'm now trying to add a few recent posts on the home page template, and I'm having trouble with the Read More functioning correctly... The entire post is displayed rather than just the excerpt. Here's the code I have in home-content.php:

    <?php query_posts('showposts=4&amp;cat=3'); ?>
      		<?php while (have_posts()) : the_post();?>
    			<div class="notebook-item <?php echo $odd_or_even; ?>">
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<h2><small><span class="alignright date"><?php the_time('F jS, Y') ?></span></small><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    
    					<?php the_content('read more...'); ?>
    
    			</div>
    			</div>
    			<?php $odd_or_even = ('odd'==$odd_or_even) ? 'even' : 'odd'; ?>
    			<?php endwhile; ?>

    Does anyone know how to get the Read More to function outside of the main blog (index.php) page? I know I could use 'the_excerpt()' but I don't like how it ends with [...].

    Thanks,
    Bryan

  2. Shane G
    Member
    Posted 6 years ago #

    Hi,

    Do verification of your code for read more with this:

    http://codex.wordpress.org/Customizing_the_Read_More

    Thanks,

    Shane G.

  3. Bryan Hoffman
    Member
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic