WordPress: Manually control which blog pages show excerpts and which show full posts

Here is how to manually control which blog pages on your WordPress site display posts as excerpts and which show the entire posts.

For the site that I developed this solution for, the pages are set up to display posts from a particular category on each particular page.

First, open the loop-page.php file in your WordPress admin panel.

Between the two tags:

and , paste this code:

<?php if ( is_category(3) ) { ?>
<?php the_content(); ?>

<?php } else { ?>
<?php the_excerpt(); ?>

<?php } ?>

In this example, we are telling WordPress that if the page is displaying posts from category ID 3, show the entire post. Otherwise, on all other pages, show the exerpts of posts.

Of course, you will want to edit to whatever category ID or page ID (using ) or post ID (using ) that you are trying to control.

If you want to control the excerpts and/or full posts on multiple pages or posts or categories, you would use this line at the beginning of the previous code:

<?php if ( is_category(array(3,5)) ) { ?>

Let me know if you have any questions or trouble with this!