How to Display Post Excerpts in WordPress

[easy-social-share counters=0 style="button"]

WordPress is the easiest method to set up a web site and a blog.

We have used Squarespace, Drupal, Octopress and also made from scratch. All these have their advantages and disadvantages.

Whenever you set up your own WordPress web site, by default the home will become a blog feed.

For the most part this feed has the full text of a blog post.

The advantages of having excerpts instead of full text are:

It decreases web page load time

It will increase web page see count

These types of advantages are clearly explained in more detailed on this post about how exactly to show post excerpts in WordPress themes or templates

Helping to make this change is not very simple to spot. It’s not section of the Settings in WordPress in fact it is possible that you should have excerpts not showing up.

You are required to edit all these three data files:

  1. index.php
  2. archive.php
  3. category.php

In the Admin part of WordPress go to Appearance, and then Editor:

menuexcerpet

When you are using WordPress it is very important learn a few code.

You are required to try to look for the code: <? php the_content( ); ?>

And also change it with the code: <? php the_excerpt( ); ?>

The Best Way To display Post Excerpts

Edit Index.php To Show Post Excerpt

No matter which theme you can be by using, the name index.php will appear in parenthesis:

indeximg
Click that file folder and also using Look for to search the text “the_content”

Dependent on your own themes you will probably find it or is not.

Within my case Now I am by using the Themes “Sparkling” and also I can not try to find such collection. But yet I found the following:

wordpress-editor-index-the_content
This code transform to “Get each and every blog post and also set up a listing of them”.

Don’t be afraid of code.

It tells: while there are actually posts put a post.

And then tells: Include the post format , if you would like to adjust it and then insert a few file…etc.

The next collection says get_template_part( ‘content’, get_post_format());

When you read it like that it only makes sense: Get the template, get me the articles or the post format.

We will need to change a code that tells it the_content to the_excerpt

We are now trying to change the format of the post articles, from “showing me the complete content” to “show me only just an excerpt”

The previous code provides me a few ideas. In case I would like to change the format I require to edit a few other data file also it starts off with the word “content”.

Remember that that is particular for the Sparkling WordPress theme but yet the similar process can be used for your own themes.

Taking a look at my editor I found the following data files:

wordpress-editor-content-files

Edit The content.php File

Try to find a collection that says the_content

this data file has both of them “the_content” and also “the_excerpt”:

wordpress-editor-content-the_content-the_excerpt
We are now grateful. The web developer left a few notes right now there and so we might be able to know it much better.

It says just to display Excerpts when you use Search. And then has an “else” as in: Only display Excerpt when you use Search otherwise display the whole Articles.

Let’s change “the_content” to “the_excerpt”. And then click “Update File”.

Right now go to your web site so you will find that your own home web page displays only just Excerpts of each and every blog post.

Edit Archive .php To Show Post Excerpt

This data file displays usually the same code that the index.php. It calls a few other data file to get the format of the posts. For this reason it can be calling the data file content.php.

Manual and Automatic Excerpt

Automatic Excerpt shows the very first fifty five letters, while manual excerpt can become inserted for each and every post. When you don’t notice this field. Go to the top of the post:

wordpress-screen-options-button
Check out the box “Excerpt” therefore you will find the following field appear toward the bottom part of the post:

wordpress-manual-excerpt-blog-post
This is the way it looks published on the home web page:

wordpress-manual-excerpt-published

Hope you all like this Tuts byCodiTuts.com, if yes then keep us supporting by sharing this post, Cheerful Coding smiley.

Submit a comment

Pin It on Pinterest