Changed post full content to post excerpt in Twenty Fifteen

WordPress Twenty fifteen theme does not have feature of display post excerpt instead of full content but this snippet code will fix excerpt.

Normally, Twenty Fifteen theme does not have an option to show only post excerpt on home page blog loop. It will show complete blog article even we have entered excerpt content while writing article.

I thought instead of showing complete article on home page, it would be better if I only display excerpt and to read complete article, reader would have to visit post. This technique will improve article page views.

But, How to display excerpt when there is no option? was my next question in mind. I did some random search and found that using the_excerpt hook in WordPress will make it work. I found complete code in WordPress forums, thank to forum participant.

How to modify file for post excerpt?

Login to WordPress admin > Appearance > Editor > open content.php file. Look for below code in content.php file

And replace it with below code:

Related:  Disable Month and Year upload folder for WordPress

Commit the changes and check home page of Twenty Fifteen. Post excerpt will appear instead of full article. If you have manual excerpt content as BeingBlog have, then it will only display manual excerpt. Else, it will auto-generate excerpt from content and display on home page.

Related:  Stop infinite redirect loop for WordPress Sub-directory Multisite

Note and Conclusion:

Now we are successfully displaying post excerpt instead of complete article. We hope this will help in generating few page views.

If you have any thoughts, post in below comment box.

You may also like...

Leave a Reply

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