Categories: Wordpress Basics

Excerpt lenght and ‘Read More’ tags in WordPress

Excerpt Introduction

The Excerpt introduced to WordPress after 0.71 version but it can control after 2.9 version and it refers to an optional summary or description of a post; that we can say, a post summary. Automatic excerpt which contains first 55 words of the post’s content will be displayed unless you do not provide an explicit excerpt to a post (in the post editor’s optional excerpt field).

The Excerpt has two main uses:

  1. It replaces the full content in RSS feeds when the option to display summaries is selected in Dashboard › Settings › Reading.
  2. Depending on the WordPress theme, it can be displayed in places where quick summaries are preferable to full content:
    • Search results
    • Tag archives
    • Category archives
    • Monthly archives
    • Author archives

How to display excerpt in post/article:

if your current theme showing content only in blog post or article, remember the theme using wordpress content function to display it.

<?php the_content() ?>

Now, if you want to change it to show excerpt just replace the below code inside your post loop:

<?php the_excerpt(); ?>

 

If you want to use any conditional tags for showing excerpt in your category or archive post type just follow the below example:

<?php if ( is_category() || is_archive() ) {
 the_excerpt();
} else {
 the_content();
} ?>

 

How to change the limit & Tag for Excerpt:

Its pretty simple to change the default excerpt length in wordpress. Suppose you want to exceed your length to 100 words then paste the below code in function.php file.

Code:

add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_length($length) {
    return 100;
 }

Right now, if you want add your own words to point the end tag of excerpt (default: [….]) paste the below code which will show ‘Read More Here….

add_filter('excerpt_more', 'new_excerpt_more');
function new_excerpt_more($more) {
    return 'Read More Here…';
 }

That’s all. Further need any information regarding this issue just drop a comment in below. Hope our feedback satisfy your requirements. Thanks.

This post has already been read 3720 times!

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

More Posts

Mehedi Hasan

Cool WordPress Developer having much agile experience to develop any kind of WordPress sites & plugins. Also good in troubleshooting, fixing & making any kind of tweaks for WP site.

Share
Published by
Mehedi Hasan

Recent Posts

WP Share A Friend – A Way to Capture Lead

What is Lead Capture: In general sense lead capture designates a process or way of…

5 years ago

Unlimited Modal POPUPS on MouseClick

Introduction Unlimited Modal POPUPS on MouseClick: Everyone knows about popup during site visits and most…

5 years ago

WordPress Pregnancy Calculator Plugin

Brief about Pregnancy Calculator : This WordPress Pregnancy Calculator plugin allows users to display an…

5 years ago

Interactive Service Plugin with Hover Effects VC

Introduction About this Service Plugin: This Visual Composer Service Plugin works as an addon to…

6 years ago

WP Dynamic Query String

Introduction of Dynamic Query String : This plugin allows user to set dynamic query string…

6 years ago

How to make scroll PDF in iFrame for iPAD Safari

There is an occasional bug for iPhone and iPad even they are designed as well and…

7 years ago