I’m building a custom WordPress theme.In my index.php page i’m looping to display the excerpts for all of my blog-posts.
this is how I break the post flow:
//At first I place <!--more--> in my post-text where I want to break it..
the_content('more');
Now the point is I’d like to place the ‘more’ button not right after the excerpt.I’d like to place this button in another div containing other link-buttons (tags,comments-count ecc).
The only thing I came up with is using a span around the ‘more’ button (with absolute positioning).
Is there any better solution?
thanks
Luca
The fact that WP injects the read more link into excerpts, rather than just giving the formatted excerpt, has always been a problem for me, too. Especially since what surrounds the link is dependent on where the author placed it: inline or on a new line, before or after an image, inside or outside inline markup. Here’s what I’ve done in the past — I’m not sure whether this is the best solution but it should work…
$content = $post->post_content
explode("<!--more-->", $content)
.the_content
filter:$excerpt = apply_filters("the_content", $content[0]);
$excerpt = force_balance_tags($excerpt)
On the whole, a better solution may be to ask authors to provide a text excerpt to go with each post rather than relying on this kloodgy method.