Show excerpts on homepage for WordPress users running twenty twelve theme

Earlier I talked about How to add adsense code below post title in wordpress twenty twelve theme. Now we are going to see how to only show excerpts instead of full post in the homepage, if you are running twenty twelve theme.

Experts would recommend you first create a child theme for any theme modifications, as the theme would updated and all your changes would get lost. Let’s do that later assuming that you take a backup of your current theme before updating, as this is what I have been doing till I discovered child themes.

Since this is a quick and easy code edit, lets talk about child themes later on, and talk about showing only the excerpts.

To do that, from your theme editor, hop over to content.php

twenty-twelve-show-excerpt-homepage

Click on the image for  the larger view, but I am including the code here, anyway.

Once you have opened content.php, scroll through the code till you see

Now this line is important as we’ll be changing the code from

to this,

Now the excerpts will not only displayed on search page but also on the home page.

 

4 comments

Leave a Reply

Your email address will not be published. Required fields are marked *