• 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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Scott Reilly

    (@coffee2code)

    WordPress & Plugin Developer

    There is a bug report on Mosquito related to this issue (which isn’t limited to just the <blockquote> tag: http://mosquito.wordpress.org/view.php?id=178

    The patch attached to that bug may not apply so cleanly as it was created months ago and the WP code has probably changed things up a bit since then, but the approach should still be valid.

    Thread Starter mat8iou

    (@mat8iou)

    Thanks for that info. I’ll have a look at the patch when I have time & see if it works – It counds like a better solution than my kludged together attempt anyway.

    Thread Starter mat8iou

    (@mat8iou)

    It appears to validate fine now after applying the patch from the post you linked to.

    Many thanks for the advice.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘XHTML validating & the <!–more–> tag’ is closed to new replies.