Custom More Text With WordPress In Functions.php
function custom_more($more_link, $more_link_text) {
return str_replace($more_link_text, 'Keep reading this post', $more_link);
}
add_filter('the_content_more_link', 'my_more_link', 10, 2);
////////////////////////////////////////////////////////////////////////////////
Showing Posts With Custom Excerpt Length And Custom Read More Text In WordPress
<?php
//showing welcome post (post id =1)
// retrieve one post with an ID of 5
query_posts( 'p=1' );
function new_excerpt_length($length) {
return 28;
}
add_filter('excerpt_length', 'new_excerpt_length');
function new_excerpt_more($more) {
global $post;
return '<a href="'. get_permalink($post->ID) . '"> <br />read more....</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
// set $more to 0 in order to only get the first part of the post
global $more;
$more = 0;
// the Loop
while (have_posts()) : the_post();
the_excerpt();
endwhile;
?>