• I’ve started to use <section> in my blog pages instead of div’s, where appropriate. However, after editing a page and saving it, WP auto-edits the code to add closing section brackets at inappropriate places.

    Example of what I want to use (closing section brackets are near the end of my page, after relevant content)…

    <section class="plexus"><section class="plexus-container"><img src="https://imge.jpg" alt="Plexus Weight Loss" />
    [three_fifth]

    Here’s what WP does; notice the added, closing section brackets…

    <section class="plexus"><section class="plexus-container"><img src="https://image.jpg" alt="Plexus Weight Loss" />
    [three_fifth]</section></section>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    How do I stop WP from making these unnecessary edits?

Viewing 4 replies - 1 through 4 (of 4 total)
  • It look’s as if the closing tags are in the proper place. If you do not want them there, add the closing tags in yourself.
    If not try adding this in functions.php
    remove_filter( ‘the_content’, ‘wpautop’ );
    remove_filter( ‘the_excerpt’, ‘wpautop’ );

    Thread Starter cableghost

    (@cableghost)

    Thanks @f1ss1on, though there may be a misunderstanding. I did not add all the section content in the example above. The above is just the opening tags of the sections. In which case, the closing section tags are not appearing where I placed them; WP is moving them.

    I set open and closing tags, i.e.,

    <section><section><img src=”https://image.jpg&#8221; alt=”Plexus Weight Loss” />
    [three_fifth]my content[/three_fifth]</section>more content</section>

    WP is doing this…

    <section><section><img src=”https://image.jpg&#8221; alt=”Plexus Weight Loss” />
    [three_fifth]</section></section>
    my content[/three_fifth]
    more content

    I’m not familiar with those filters; are they just telling WP not to make any changes? Will this affect shortcodes or any other WP built-in functioning?

    Thread Starter cableghost

    (@cableghost)

    As a follow-up…I went back to using div’s…WP doesn’t make changes.

    BFM Script

    Dear cableghost,

    you wrote:

    I have the BFM script installed and it works fine on my domain from its installed directory, but I cannot get it to work within a WP blog.

    I would simply like to use the BFM script as a members only script to gain access to a specific page. My guess is that I need to call the script from a Template and not certain how to do that.

    Any recommendations?

    How did you resolved it? Can you help me?
    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WP auto-editing Section Elements’ is closed to new replies.