The following functions.php edit (contributed by helgatheviking on the themeshaper forums) allows the use of a “Read More” link with custom excerpts.
My problem is simply this: I’m inept at editing functions.php code, but I’d like to safely remove the “wrap excerpt in p tag” portion of this script.
How would I do so?
Thanks.
Original script is found here:
http://themeshaper.com/forums/topic/enclosing-excerpt-in-paragraph-tag-038-adding-a-custom-read-more-link
// excerpt read more links and wrap excerpt in p tag
function all_excerpts_get_more_link($post_excerpt) {
return '<p>' . $post_excerpt . '</p>' . '<p class="readmore"><a href="'. get_permalink($post->ID) . '">' . 'Continue Reading »' . '</a></p>';
}
add_filter('wp_trim_excerpt', 'all_excerpts_get_more_link');
This should remove the
<p>
tags, but leave the styling by replacing the paragraph tag with a<span>
class:Delete the empty
''
it makes no sense on leaving them: