wordpress_post_excerpts

You are here because you want to :

  • Show only post excerpts on the pages you choose amongst Search Pages, Category Listings, Archives and your blog index page
  • But still show the full posts on the posts page (there has to be the full post somewhere, right?)
  • Use a shortcode to decide the post summary and insert a [Read More..] link after the summary

Here’s how you can decide where to show post excerpts and where to show the complete post :


Method 1 : Using the More Tag (No need to edit templates)

You can add <!–more–> anywhere on your post in the HTML editor to decide the content to be shown as the excerpt. Everything before this tag will be shown and a “More” link will be added to view the rest of the post.

if you’re not a big fan of the HTML editor, find the More icon (which looks something like excerpts ) on the Visual editor.

The single post page will be unaffected but will appear as excerpts on all pages with multiple post listings (this includes the above mentioned – index posts page(if front page is set to display recent posts), archives, category listings & search results.

You can add your own text to the more tag and make it something like <!–more Read On.. –>. It will now shoe “Read On..” instead of “More”. Happy? But wait, there’s more.. What if you want excerpts only in search results but full posts everywhere else? See Method 2.

LimitationCan’t choose which pages show full posts and which pages show excerpts.

 


Method 2 : Make changes in templates where you want excerpts

You can change your templates and make them show only post excerpts instead of full posts. Note that these excerpts are decided by WordPress(120 words) and not by you. Though, if you want, you can write excerpts for every post.(To do that – Go to Edit Post > Screen Options on top-right corner > Check Excerpts > Write an Excerpt in the box)

You can change any of the following pages :

index.php / archive.php or archives.php / category.php / search.php

Choose the page in which you want to display excerpts (preferably just search and archives) > Find the php function the_content() and replace it with the_excerpt

Which means that you need to replace <?php the_content ()?>
with <?php the_excerpt ()?>
wherever you want to replace full post content with post excerpt, Simple.

LimitationYou cannot decide the length of the excerpt for a particular post. It is set to a default of 120 words. However, You can write excerpts for individual posts.

 


Method 3 : Use A Plugin

If you feel like experimenting more with excerpts, try out one of the plugins for customizing and showing excerpts on WordPress. You can find these plugins here. Though, you should never use a plugin to do what you can do by tweaking your files or using the inbuilt WordPress features. However, you can use them to extend their functionality.

Limitation You need to find out which plugin suits your needs and does what you want, Update plugins, Make sure it works with the new version of WordPress, & so on. As I said earlier, It’s usually not a great idea.