The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. yitwail
    Posted 4 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.


  2. Johan van der Wijk
    Plugin Author

    Posted 4 years ago #

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

  3. yitwail
    Posted 4 years 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

  • Custom Post Widget
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic