How To Control Excerpts in Twentytwelve Posts Page

I’m having a bit of an issue changing the blog home page (otherwise known as the Posts page) to be except only. I am trying to do this without a plugin.

It seems that when I go to Settings > Reading I can choose a “homepage” for my posts. I have created a page, called it “Blog” and made that page the Posts page.

However, no matter what I do, I have the full content showing in the blog “homepage.” I am going back to the internet now to find the answer. I know it is a simple one, and part of the reason I wrote this article was so I had two posts to work with instead of just one. BRB!

OK< so it’s 15 minutes later and I found the answer on this website called zeaks.org. I forgot to mention I’m using a modified version of the twentytwelve theme, so this advice works perfectly.

Edit Template files

Open content.php and around line 33 find

1
<?php if ( is_search() ) : // Only display Excerpts for Search ?>

This conditional tells your theme to display excerpts only for the search page. To make it also display them on the home page add is_home to it like this.

1
<?php if ( is_search() || is_home() ) : // Display Excerpts for Search and Homepage ?>

Save and close content.php and refresh your site. You should see posts displayed as excerpts, but there’s more you can do.

This even works for the blog homepage (AKA the Posts page), even though the code is calling it home page. Apparently I need to learn more about how the posts page is created and how it uses the homepage template.

This entry was posted in Uncategorized on by .

About Paul Phipps

Paul started off in I.T. almost 15 years ago. He rose to the highest level at the last two companies he worked for (once as I.T. Director and another time as Marketing Director). He is serious about helping your company succeed and he knows what's going on in technology and marketing -- right now. Your company deserves modern business solutions. Call Paul now.