Support

Account

Forum Replies Created

  • I tried the function like Elliot showed above and it worked great!
    I did one per filter for the moment in my header.php:

    function the_content_without_filters( $the_content=null ) {
        remove_filter('the_content', 'wpautop');
        if( $the_content ) {
          the_content( $the_content );
        } else {
          the_content();
        }
        add_filter('the_content', 'wpautop');
      }
    
      function the_excerpt_without_filters( $the_excerpt=null ) {
        remove_filter('the_excerpt', 'wpautop');
        if( $the_excerpt ) {
          the_excerpt( $the_excerpt ) ;
        } else {
          the_excerpt();
        }
        add_filter('the_excerpt', 'wpautop');
      }
    
      function the_field_without_filters( $the_field=null ) {
        remove_filter('acf_the_content', 'wpautop');
        if( $the_field ) {
          the_field( $the_field );
        } else {
          the_field();
        }
        add_filter('acf_the_content', 'wpautop');
      }

    I guess you can also inverse if you need to:

    
    function the_field_without_filters( $the_field=null ) {
        add_filter('acf_the_content', 'wpautop');
        if( $the_field ) {
          the_field( $the_field );
        } else {
          the_field();
        }
        remove_filter('acf_the_content', 'wpautop');
    }
Viewing 1 post (of 1 total)