Articles of wp autop

Replace wpautop in WordPress plugin to remove <p> tags

The line of code that is causing the paragraph tag is: $output .= rs_set_wpautop( wp_kses_data($content)); Does anyone have a recommendation for editing that line to remove the automatic paragraph tags? In other words, can we replace wpautop with anything? // begin output $output = ‘<div’. $id .’ class=”dl toggle”‘. $class .’>’; $output .= ‘<div class=”dt”>’; […]

Keep br tags from stripping

Is there some filter to disable this, sometimes awful feature? I need content of some custom post type to be displayed intact, with all of <br>s. To get the content I’m using get_the_content(); inside of WP_Query loop, inside of shortcode function. I’m grateful with any clue, but answer without the word “plugin” would blow my […]

wpautop filter off for pages but on for posts

I have the wpautop on remove filter for my pages but would like to turn it on just for posts and was wondering how to go about that. I’m newish to wordpress and can’t figure out how to get this to work. UPDATE: I found a working solution here:

remove_filter( 'the_content', 'wpautop' ); is not working for me

I use Tinymce Advanced plugin. I would like to remove p tag by adding this code remove_filter( ‘the_content’, ‘wpautop’ ); to my functions.php. However, it does’t work. When I press ENTER, it still inserts double line, not single line. The p character still displays at the bottom left of the textarea.

Formatting <code>?

I have serious trouble displaying code blocks in my theme. I want to display something like: <something> <something-else> Content </something-else> </something> And it works fine everywhere, but doing that inside code tag: <code> <something> <something-else> Content </something-else> </something> </code> Displays code block looking like: <something> <something-else> Content </something-else> </something> And setting code’s CSS to: white-space: […]

Possible to disable autop temporarily?

If I disable autop entirely, I need to add <p> everywhere I want a paragraph. Is it possibe to disable autop temporarily? Like in a shortcode

Cannot stop wpautop from messing up my plug-in output

I have a plug-in that embeds some javascript. I’ve tried using remove_filter() to stop wpautop in every way recommend and still can’t get wordpress to stop wrapping my <script></script> tags with with <p> tags like this <p><script></script></p> I tried adding the following to both the short code php and also in the functions.php remove_filter( ‘the_content’, […]

Strip <p> from <blockquote> or something better?

Looking for some help on something that has me really contemplating not using blockquotes for the moment! I have this code: <?php $show_after_p = 1; $content = apply_filters( ‘the_content’, get_the_content() ); if(substr_count($content, ‘<p>’) > $show_after_p) { $contents = explode(‘<p>’, $content); $p_count = 1; foreach($contents as $content) { $content = str_replace(‘</p>’, ”, $content); echo wpautop($content); if($p_count […]

If is_single in functions.php

I want the remove wpautop filter working only on posts from my blog. Because at some pages i need the autop, and at some pages i need it to not be there. I use the following rule and it is in my theme’s functions.php: remove_filter( ‘the_content’, ‘wpautop’ ); Because I only want it on blogposts […]

remove and then add wpautop

I’ll start by saying yes, I searched, and yes, I found an answer to this question. It’s basically the solution I came up with but I want to make sure this isn’t a bad solution. Here’s the real question. I want make the post title a part of the first paragraph on certain types of […]