How to display excerpts in WordPress posts.

To display post excerpts in WordPress, put this code in the index.php

<?php if(is_single() || is_page()) { ?>
		<?php the_content(__('(more...)')); ?>
<?php } else { ?>
		<?php the_excerpt(__('(more...)')); ?>
<? } ?>

This will display full posts when the post is clicked, but excerpts on the main blog page. This is a simple way to customize your WordPress page and make it easier to read and navigate.

No comments have been made. Use this form to start the conversation :)

Leave a Reply