XHTML validating & the <!–more–> tag
-
On my site I have a lot of posts that are a couple of lines introduction followed by a lengthy blockquote.
I want to have the<!--more-->
tag a couple of paragraps into the blockquotes.However if I do this it does not validate as XHTML because the blockquote does not get closed (& depending on the theme used the page can end up looking a complete mess as a result.)
After a bit of fiddling about, I thought that I could solve the problem by adding a custom field called brokenquote to denote posts where the blockquote needed closing after the
<!--more-->
tag.However, it works to an extent, but all the tags around this point in the post are still nested incorrectly stopping it validating. Whatever I do the
<a>
for the continuation text always starts before any of my modified code.An example should make it slightly clearer what I mean:
<div class="postentry">
<?php $brokenquote = get_post_custom_values("brokenquote");
if(count($brokenquote) > 0) the_content('Read the rest of this entry ???</blockquote>
');
else the_content('Read the rest of this entry ???'); ?>
</div>Produces output where the tags are nested like this:
<blockquote>
<a href="link.html">
Read the rest of this entry ???
</blockquote>
</a>
Where you can see that the blockquote & a & p tags are all half overlapping one another.
Any suggestions of the best way to approach this problem would be welcomed.
- The topic ‘XHTML validating & the <!–more–> tag’ is closed to new replies.