try:
return $output . '<a href="'. get_permalink($post->ID) . '"> Read More of ' . get_the_title($post->ID) . '</a>';
or:
return $output . '<a href="'. get_permalink($post->ID) . '"> Read More of ' . $post->post_title . '</a>';
thank you so much it works but how can I put the read more link right after the excerpt not underneath of it
thank you in advance
untested, try:
function excerpt_read_more_link($output) {
global $post;
if($post->post_excerpt) : //provision for manual excerpt
return $output . '<a href="'. get_permalink($post->ID) . '"> Read More of ' . $post->post_title . '</a>';
else:
return substr($output,0,-5).'<a href="'. get_permalink($post->ID) . '"> Read More of ' . $post->post_title . '</a></p>';
endif;
}
add_filter('the_excerpt', 'excerpt_read_more_link');
It dosent work i get blank pages( so I had to remove this code)
and put back my previous one
function excerpt_read_more_link($output) {
global $post;return $output . '[...] Read More of <a href="'. get_permalink($post->ID) . '"> ' . get_the_title($post->ID) . '</a>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');
lol sorry it works perfectly.
The problem was the code that you sent me was formatted im my email so I took the code directly from this thread.
heehee thank you man
Another problem.
If I leave the auto excerpt the read more link is following the excerpt.
But if I write my own excerpt the read more link goes underneath the excerpt like if there’s a new line or paragraph?? weird
can you help me again please
But if I write my own excerpt the read more link goes underneath the excerpt like if there’s a new line or paragraph?? weird
this was the reason for the conditional section in the last suggested code – because a manual excerpt can have any kinds of html tags at the end, simply replacing the last characters (usually the closing paragraph tag </p>) won’t work.
however, if you don’t have anything else than simple paragraphs or text at the end of your manual excerpt, simply try to work with this code:
function excerpt_read_more_link($output) {
global $post;
return substr($output,0,-5).'<a href="'. get_permalink($post->ID) . '"> Read More of ' . $post->post_title . '</a></p>';
}
add_filter('the_excerpt', 'excerpt_read_more_link');