Add read more button with the_content() function

in WordPress on

Its quite simple to add the Read More button with the_content() function, the_content() function is displaying the content of the current post but if its find the tag into the post then its only display the upper content of this tag into the single post. This is how it looks like in the template part.

What we have to do is, just make the_content() function blank and add the button function under the_content() function into your template file. Take a look on the codes.

 

Now go the your themes functions.php file and add the following function that we have used to display the button, but wait a minute. I think you have question that why i am using the if( ! is_single() ) condition? This is because we want the read more button on the blog page not the full post page. So here we created the open the functions.php file and added the following function: