Divi WordPress Theme
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Mysterious p tag in code–how to troubleshoot?

Discussion in 'Misc WordPress Requests' started by cag8f, Dec 29, 2017.

  1. cag8f


    Reply To: Mysterious p tag in code–how to troubleshoot?, by cag8f

    Thanks for the reply. I’m a little confused though, can you clarify your last message?

    I think we’re in agreement that wpautop double line breaks to <p> tags (page here). And I think that explains the reason that <p> tags are appearing in my source code (screenshots)–would you agree?5

    My issue is that the code that should disable wpautop does not seem to be working as expected. When I add that code, I still encounter the same <p> tags:

    add_action('spacious_before_body_content', 'nobrp');
    function nobrp() {
    remove_filter( 'the_content', 'wpautop' );
    remove_filter( 'the_excerpt', 'wpautop' );
    function wpse_wpautop_nobr( $content ) {
    return wpautop( $content, false );

    Screenshot. Any ideas why this code isn’t disabling the <p> tags?

    As a test, in the text editor, I put everything on the same line. The source code still had everything wrapped in one <p> tag (screenshots). This is still with remove_filter( 'the_content', 'wpautop' ); applied.

    I think right now I should focus on why my code isn’t disabling the <p> tags as expected. What are you thoughts?

    Reply To: Mysterious p tag in code–how to troubleshoot?

Share This Page

Monarch Social Sharing Plugin