Articles of wp autop

Selectively remove empty line after line change

In WP post editor, how can I change lines without adding an empty line? I try to post this One line Second line third line But it always shows like this One line Second line Third line PS: I don’t want to completely remove wpautop, because it will probably ruin all my previous posts.

Remove wpautop from specific shortcodes only

I need to disable wpautop for some shortcodes. I’ve read the following on how to disable it: http://www.mstoicthemes.com/disable-wpautop-shortcodes/ https://customcreative.co.uk/resolving-wpautop-and-shortcodes/ However these apply to wpautop in general. I want to only disable it for specific shortcodes, because some shortcodes in my theme rely on that wpautop in order to work.

TinyMCE – no auto formatting using the_editor()?

I’m embedding the_editor on a admin page: <?php the_editor(get_option(‘options_name’),’options_name’); ?> And everything works fine, at least in back-end: BUT on the front-end side I’m always getting inline output, there are no automatic paragraphs, breaks etc. They’re just not being created. When I type them manually using HTML tags – it works. Any ideas what’s wrong? […]

wpautop on section

I removed automatic formatting in my WP site by adding this to functions.php: remove_filter( ‘the_content’, ‘wpautop’ ); remove_filter( ‘the_excerpt’, ‘wpautop’ ); Now I need to add it back into one section only. On page.php, I want to replace the_content with wpautop formatted content. I replaced this: <section class=”post-content clearfix” itemprop=”articleBody”> <?php the_content(); ?> </section> With […]

Removing <p> tags around <div> tags

I’d like to stop WP from wrapping <p> tags around <div> tags in the TineMCE editor … Here’s what I’ve got: function filter_ptags_on_images($content) { return preg_replace(‘/<p>([^>]*)<\/p>/i’, ‘$1’, $content); } add_filter(‘the_content’, ‘filter_ptags_on_images’); That removes all <p> tags around text but nothing that is wrapped in <p><div>text</div></p>. I’d also like to know a solution if I have […]

Wrap Shortcodes and wpautop

WP has me pulling my hair out at the moment (past few days trying to solve). Trying to do some simple shortcodes which wrap around various points of an article. However wpautop() I believe is wreaking havoc. Ive tried various suggestions found around the net including viperbonds ( http://www.viper007bond.com/2009/11/22/wordpress-code-earlier-shortcodes/ ) to control when the shortcodes […]

Make WP not format code, not insert line breaks in between tags

Gahhhh! Are you kidding? Ok, I guess wp wants my source code all nice and formatted… <a href=”/asdf”>i’m a link</a><ul><li>list item</li></ul> becomes <p><a href=”/asdf”>i’m a link</a> <ul> <li>list item</li> </ul> Ok, so it puts a unclosed p tag, that sucks, but who cares. Also, I wouldnt care about the formatting, but when you put a […]

get wpautop to not wrap tags but only text

Is it possible for wpautop to only wrap plain text, so that e.g. here: text <a href=””>link</a> only the “text” gets wrapped. Why would you want to wrap tags anyway? Maybe anyone has a custom function?

TinyMCE strips breaks inside editor

the posts are shown correctly in the frontend. But when i go to edit, the content inside tinyMCE is without breaks ?! So i have to copy my content from frontend and paste it to the editor every time i want to edit.. very stupid – i dont know what i’ve done, maybe it’s the […]

WordPress editor strips out anchor tags when they appear on their own line

In the text below, when I toggle the WYSIWYG view from Visual to Text, the anchors are left intact. However, when I switch back to Visual, the anchors are replaced with &nbsp; elements. This is the initial content markup in the WordPress editor (via Chrome inspector): <body id=”tinymce” class=”mceContentBody content post-type-post post-status-publish post-format-standard wp-editor” onload=”window.parent.tinyMCE.get(‘content’).onLoad.dispatch();” […]