• Resolved jcprovideo

    (@jcprovideo)


    I want to use this bit of code in one of my posts.

    <object class="post-download" href="#">
            <p><span>Download Sample Files</span>File.zip</p>
            </object>

    However, when I enter this code in the WordPress post, WordPress moves the closing tags, completely screwing up what I was trying to accomplish. Here is what WordPress is changing it to:

    <object class="post-download" href="#"></object></p>
    <p><span>Download Sample Files</span>File.zip</p>

    Anyone know why this is happening? It also happens if I replace the object tag with an anchor tag. Please help!! ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jcprovideo

    (@jcprovideo)

    Any help here?

    Can you use an href in an object tag? Also, you can’t have paragraphs in an anchor tag.

    I don’t know if you are or not, but do not use the visual editor at all if you are editing your own code. Also, avoid any line breaks in your code, have it all on one line so that WordPress doesn’t try formatting it like text.

    Thread Starter jcprovideo

    (@jcprovideo)

    Thanks chief! I will make those edits, and thanks for the tip about 1 line.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WordPress closing HTML tags early?’ is closed to new replies.