When your Theme Doesn't Do the Obvious - Montana Webmaster

When your Theme Doesn’t Do the Obvious

When your Theme Doesn’t Do the Obvious
Very few of my WordPress clients have true blogs. But, when they do, the communication needs for the home page are pretty specific … show viewers the excerpts from as many recent posts as makes a reasonably long web page.
But, the Twenty Sixteen theme doesn’t do that without customization. So, what customizations did I do to make it happen for our friends Michael and Kathy?
What What We Want
The theme only shows the full posts on the home page. This makes the page ridiculously long and difficult to figure out for a new viewer. What we want is excerpts with a photo. And, instead of full size photos, we want only the Featured Image to show in a thumbnail size.
How to Get What We Want
WordPress Twenty Sixteen File Structure. Home page changes start at the index.php file.

The overall task is to use the WordPress core function called the_excerpt() instead of the_content(). Reading the code and looking up forum posts showed that. Other themes have the the code for excerpts on the home page, but not Twenty Sixteen. So, I could have copied the code from another theme, but I found that someone else had already posted it!

Finding the file that needs to be changed starts with index.php. That is the default home page in a WordPress install. It is actually the home page on most server setups, but that is a topic for a different article. With WordPress, I could create a file called front-page.php. The WordPress core programming, would see that file and understand that it’s the home page. But, it doesn’t end there. The index.php (or front-page.php) files “call” a lot of other files. So the key is to know how WordPress works in general to go to the correct file to make changes.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.