Support » Plugin: Content Blocks (Custom Post Widget) » [Plugin: Custom Post Widget] paragraphs added by wpautop

  • Resolved yitwail


    Johan, I used your terrific plugin to display some nested shortcodes in the sidebar, but when I ran W3C validator on the page info code, it did not validate because a </p> tag was added before the matching <p> tag. When I cut & paste the HTML in the custom post to a text widget, it did not have this problem. I then added this code to post-widget.php and the problem also went away:

    if ($priority = has_filter('the_content', 'wpautop')) {
    	remove_filter('the_content', 'wpautop');
    $content = apply_filters('the_content', $content);
    if ($priority) {
    	add_filter('the_content', 'wpautop', $priority);

    so I think wpautop was the problem. Can you provide an option to suppress wpautop like text widget, or else disable it like I did in my snippet? Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Johan van der Wijk


    Hi Yitwail, the latest version of the plugin now has the option to completely disable all filters from the content.



    that’s terrific! i’ll use it in my next project i’m sure. just the other day i discovered texturize filter turning an html <!-- comment --> into gibberish.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Custom Post Widget] paragraphs added by wpautop’ is closed to new replies.