PUBLIC INDEX legacy zcourts.com ZCOURTS - VOL. 02
LONDON - 2026
Limit wordpress post content out put automatically
This is a quick and dirty hack to limit the amount of words wordpress outputs on your homepage.
Static article
Imported body
Legacy aliases
Article archive
FIG. 02
notes
surface
research
surface
Article
app model
publish
surface
Imported writing rendered as native Fission Markdown content.
SECTION
Source and context.
The static release keeps the original post body locally while the backend content pipeline is still being built.
legacy
archive
php
tutorials
wordpress
Published 2011-01-30 on legacy zcourts.com. Estimated reading time: 1 min.
Original routes are preserved as local aliases so older links keep resolving to this static archive.
This is a quick and dirty hack to limit the amount of words wordpress outputs on your homepage.
Its sometimes not ideal to have the entire post showing on the homepage when you have really long posts. 10 or 15 long posts will make the page take forever to load, especially if they all have images.
First thing to do is backup your theme's index.php file. So go to wp-content/themes/your-theme-name/ and make a copy of index.php just in case you mess it up and forget what the original content was...
Open the file, (the original, not the copy ) and find where it has the_content(); Replace it with:
<?php
$content = get_the_content();//apply_filters('the_content', $content);
$content = str_replace(']]>', ']]&gt;', $content);
$con=explode(" ",$content);
$i=0;
while($i<50 && $i<count($con)){
echo $con[$i]." ";
$i++;<
}
?>
<a href="<?php the_permalink(); ?>" rel="bookmark" title="
<?php the_title_attribute(); ?>">... <br />Continue reading, <?php the_title(); ?>.</a>
Change 50 in the loop to the amount of words you want to allow. When done just save and re-upload the file.
Further reading: codex.wordpress.org/Template_Tags/the_content
CR
Courtney Robinson
zcourts.com
Building the infrastructure for the agentic future.
LET'S CONNECT
courtney@crlog.info
Based in London
© 2025 Courtney Robinson. All rights reserved.