Normally all themes in WordPress by default gives read more button in excerpts (Excerpt is an optional summary or description of a post; in short, a post summary) which normally shown on category, archive and tags pages. But some themes does not provide read more button in excerpts so in that case you can use below code in functions.php file to show read more button/link in excerpts.
1 2 3 4 5 6 7 |
//Show read more button function new_excerpt_more( $more ) { return sprintf( '<a class="read-more" href="%1$s">%2$s</a>', get_permalink( get_the_ID() ), ' Read More' ); } add_filter( 'excerpt_more', 'new_excerpt_more' ); |
Note: By default the excerpt length is set to return 55 words. which means if post content is less than 55 words then read more button will not be shown, so if you still want to show read more button then you should decrease the excerpt length which you can do by pasting below code in functions.php.
1 2 3 4 5 |
//Decreasing excerpt length function new_excerpt_length( $length ) { return 20; } add_filter( 'excerpt_length', 'new_excerpt_length', 999 ); |
Thanks
Please share if you like
Comments