Add Custom Read More Function WordPress


Custom Read More Function in WordPress are very useful for illustration a web site. It is not only helpful but also save time. Suppose you have a website and you design it at various styles such as 2 column pages, 3 column page, single page, portfolio page, author page etc. Now you need to change some text or anything of you site’s all page. What will you do? You will change the text from all pages where you added it, so you need many time to change it. In this case WordPress custom function will help you to do this at less time to change it.

In this web development tutorial I will share how to add custom read more function in WordPress

Now open your functions.php file and add the below WordPress functions in it.

function read_more(){
 echo 'Read More';
}

Here I have write a function as read_more() and place some information in the function to display in the website.

How to display custom read more function in template?

To display the above function in template you need only add <?php read_more();?> to display read more text in your template. Now add the below php codes any page in your template to display Read more with link.

<a href="<?php the_permalink();?>"><?php read_more(); ?></a>

Want to change Read more text to continue reading… no problem. You don’t need to change these at all pages. Simply open you functions.php file and change read more text to your custom text like continue reading…
I only write a simple WordPress function in functions.php file. If this functions is helpful don’t forget to share with your friends and share you idea through leave a comment. Thank you.

Masum Billah has written 326 articles

Hi I am Md. Masum Billah Contributor of this website. I always like to share various things with other. In this website I am sharing web design related tips and tricks, necessary web development tools, source codes for beginner and advance web developer. You may join with us to help other who want to learn web design and development. Thank you for stay with.

Recommended Articles

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>