WordPress.org

Ready to get started?Download WordPress

Forums

Why is WP auto-closing tags? (3 posts)

  1. secondtail
    Member
    Posted 3 years ago #

    This is what I need the code to remain like:

    <div id="frontsquares">
    <a class="leftsquare" href="http://luxurycaribbeanvillarental.com/springhouse/?page_id=134"><img class="squareimage alignleft" src="http://luxurycaribbeanvillarental.com/springhouse/wp-content/themes/thematic/library/images/frontsquares/suites.gif" alt="Suites at Spring House Bequia" width="90" height="90" /><h2>Suites</h2>
    Some text about the suites... +</a>
    </div>

    What that code generates, with CSS styles applied, when it's not being mangled by WP is a box that displays a thumbnail image and text - and the background of the box changes when the user hovers. I've used it many times in non-WP sites beautifully and successfully.

    This is what WP is turning it into (even if I hard code in the HTML tab):

    <div id="frontsquares">
    <a class="leftsquare" href="../?page_id=134"><img class="squareimage alignleft" src="../library/images/frontsquares/suites.gif" alt="Suites at Spring House Bequia" width="90" height="90" /></a>
    
    <a class="leftsquare" href="../?page_id=134"></a>
    
    <a class="leftsquare" href="http://luxurycaribbeanvillarental.com/springhouse/?page_id=134"><h2>Suites</h2></a>
    
    <a class="leftsquare" href="http://luxurycaribbeanvillarental.com/springhouse/?page_id=134"></a>
    
    <a class="leftsquare" href="http://luxurycaribbeanvillarental.com/springhouse/?page_id=134"></a>
    
    <a class="leftsquare" href="http://luxurycaribbeanvillarental.com/springhouse/?page_id=134">Some text about the suites... +</a>

    What THAT mangled monstrosity generates is SIX boxes, all containing As you can probably imagine - this is REALLY annoying.

    Is there a way to get the editor - HTML or Visual - to stop closing and adding <a> tags?

  2. Why? To stop the ignorant from screwing up their sites :)

    Can yuo turn it off?

    I believe that's under Settings >> Writing

    WordPress should correct invalidly nested XHTML automatically

  3. secondtail
    Member
    Posted 3 years ago #

    Ipstenu - I have that box unchecked, and it's still happening.

    In the HTML editor after I click "update" it shows the code as I wrote it. But on the site, it shows extra code. Then - if I exit the editor and return - the mangled code is there. That's probably what's baffling me the most.

    I thought having the HTML area was supposed to give me more control but it's just giving me a headache.

    Has anyone else had luck with a adding function hook or something in their theme? I tried using a hook that filtered wpautop but that's not really been helping any as it's for the auto <p> tag function.

Topic Closed

This topic has been closed to new replies.

About this Topic