BeginnersBook

  • Home
  • Java
    • Java OOPs
    • Java Collections
    • Java Examples
  • C
    • C Examples
  • C++
    • C++ Examples
  • DBMS
  • Computer Network
  • Python
    • Python Examples
  • More…
    • jQuery
    • Kotlin
    • WordPress
    • SEO
    • JSON
    • JSP
    • JSTL
    • Servlet
    • MongoDB
    • XML
    • Perl

How to Display a Read More link in WordPress Excerpts

By Chaitanya Singh | Filed Under: WordPress

Excerpts can do wonders to your blog if showcased properly. In the last post about how to show excerpt in WordPress themes, we discussed that how they helps to improve CTR, reduces bounce rate and improves SEO then we saw how to change the default excerpt length to display a meaningful gist of the post to your visitors.

This post is all about read more link in excerpts. As we all know that excerpt should have a link to the post’s full content so here we are sharing few codes, which adds a read more link to a excerpt, in order to re-direct visitors to the full content.

This is how it looks:

Read More link in WordPress Excerpts

How to add read more link to your WordPress theme?

I have provided several codes for various types of read more link, choose the one which you like and paste the corresponding code to the theme’s functions.php file.

Link type 1: Read More »

/* Link Style 1 */
function new_excerpt_more($more) {
global $post;
   return '… <a href="'. get_permalink($post->ID) . '">' . 'Read More &raquo;' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

Link type 2: Read More ›

/* Link Style 2 */
function new_excerpt_more($more) {
global $post;
   return '… <a href="'. get_permalink($post->ID) . '">' . 'Read More &rsaquo;' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

Link type 3: Read More →

/* Link Style 3 */
function new_excerpt_more($more) {
global $post;
   return '… <a href="'. get_permalink($post->ID) . '">' . 'Read More &rsaquo;' . '</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');

If you notice, the screenshot I provided in the post doesn’t have a read more text instead it has a “Read the full article” text. You can also change the text to the one you like, by modifying the above provided code snippets. Wonder how to do?

Search the below code in above functions and replace it

Read More &rsaquo;

With this one

Read the full article &rsaquo;

That’s all I have for this topic. Let me know if you need any assistance while setting up the code into WordPress theme files.

Top Related Articles:

  1. How to Add Facebook Open Graph Meta Data in WordPress Themes
  2. How to change post excerpt length in wordpress
  3. How to Display Post Excerpts(Summary) in WordPress Themes
  4. Set Default Thumbnail, Featured Image and Fallback Image in WordPress Automatically
  5. Broken link checker wordpress plugin – Search engine optimization

About the Author

I have 15 years of experience in the IT industry, working with renowned multinational corporations. Additionally, I have dedicated over a decade to teaching, allowing me to refine my skills in delivering information in a simple and easily understandable manner.

– Chaitanya

Leave a Reply Cancel reply

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

Copyright © 2012 – 2023 BeginnersBook . Privacy Policy . Sitemap