• Resolved thetoolman123

    (@thetoolman123)


    Hi,

    I have a really annoying issue in that WP is adding a <p> tag around the following field:

    <input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn-pink">

    This is my whole HTML:

    <div class="newsletter-signup"><h2>Get Updates</h2><div class="hr-line-left"></div><div id="mc_embed_signup"><form action="https://xxx.us17.list-manage.com/subscribe/post?u=a222a862f525f829861de2a48&id=1efd4975e6" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate><div id="mc_embed_signup_scroll"><p>Sign up!</p><input type="text" value="" placeholder="*Your name..." name="FNAME" class="" id="mce-FNAME"><input type="email" value="" placeholder="*Your email address..." name="EMAIL" class="required email" id="mce-EMAIL"><div style="position: absolute; left: -5000px; margin: 0!important; padding: 0!important" aria-hidden="true"><input type="text" name="b_a222a862f525f829861de2a48_1efd4975e6" tabindex="-1" value=""></div><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe" class="btn-pink"></div></form></div></div>

    I’ve removed all spaces and also minified the HTML.

    Any ideas what’s causing this?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    You’re adding this HTML to post or page content through the normal tinyMCE content editor’s text tab, correct?

    The villain would then be this wpautop() function that all content is filtered through. Some people have explicitly removed this function from the filter stack to avoid this problem, but it can cause other layout issues with other posts created with the function in place.

    For specific HTML where wpautop() interferes, the best way to stop its interference is by inserting the required HTML through a shortcode. Shortcode output bypasses the wpautop() filtering.

    Thread Starter thetoolman123

    (@thetoolman123)

    Thanks, yes it was the wpautop() function.

    I removed it by adding this to my child theme:

    remove_filter( 'the_content', 'wpautop' );

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP adding a paragraph around field’ is closed to new replies.