Maybe you could put that text in span tags?
Thread Starter
seraph
(@seraph)
True, but that would be a little less than optimal really wouldn’t it?
I was pondering doing a preg_match for something that did a match for *<!--more-->, removed it from the post text itself and then created a new var with the contents of the matched text.
A little involved, but it’d be quite a lot more portable if I decide to not restyle in the future — I’d like to keep extraneous markup to a minimum.
Thread Starter
seraph
(@seraph)
Alright, I came up with a pretty easy solution in the end (quite a non-intensive one too). Instead of using the_content() I use this:
<?php
$more = strpos($post->post_content, "<!--more-->")+11;
if($more != "") {
echo apply_filters('the_content', '<div class="excerpt">'.substr($post->post_content, 0, $more).'</div>');
echo apply_filters('the_content', substr($post->post_content, $more));
}
else
the_content();
?>
This has the benefit of allowing flexibility, and allows it to hook into the wordpress plugin hooks as well.