Herself's Webtools

Scripts, HowTos, Templates, Plugins, Widgets, Tips

How to fix WordPress templates that only list partial posts

without comments

I really hate blogs that list part of a post followed by a ‘read more’ link. When I moved my blogs from Blogger to WordPress it seemed all the templates I liked used this partial post thing. Finally this weekend I had time to go through them, find the problem and fix it.

First you’ll need to find all the places in all the *.php files in your theme that say:

<?php the_content(‘[Read more →]‘); ?>
<p><a href=”<?php the_permalink() ?>#more-<?php the_ID(); ?>” title=”Read the rest of this entry”>[Read more →]</a></p>

You’ll need to remove all of those and replace them with full copies of the posts.

In most templates you’ll see something like:

<div class=”entry”>
<?php the_excerpt() ?>
<p><a href=”<?php the_permalink() ?>#more-<?php the_ID(); ?>” title=”Read the rest of this entry”>[Read more →]</a></p>
</div>

Replace that with this:

<div class=”entry”>
<?php the_content(); ?>
</div>

Written by Linda MacPhee-Cobb

October 5th, 2007 at 5:00 am

Posted in hack your template

Leave a Reply

You must be logged in to post a comment.