WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Widget
[resolved] paragraphs added by wpautop (3 posts)

  1. yitwail
    Member
    Posted 2 years ago #

    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.

    http://wordpress.org/extend/plugins/custom-post-widget/

  2. Johan van der Wijk
    Member
    Plugin Author

    Posted 1 year ago #

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

  3. yitwail
    Member
    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic