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

When your Theme Doesn’t Do the Obvious

What Is “the Obvious”?

“The obvious” is subjective. It’s what you expect, which may be different from what the next person expects. But, it’s generally based on previous experience and the way that something has worked in the past.

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 recent posts. This is the “obvious” because this is where WordPress started, as blogging software with a list of the 10 most recent posts on the home page. And, most WordPress themes start with the obvious, which you can switch in the dashboard.

But, the Twenty Sixteen theme doesn’t do that without customization.

When You Find Something out of the Norm in a Theme

Twenty Sixteen is an old theme that came with a WordPress install in the year 2016 and for a few years after. The front page didn’t follow the pattern of the previous default themes, but people were often used to using the default themes. And, this theme is still available in the WordPress repository.

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.