• Hi all

    I know that I shouldn’t really have my own code within a post. I know that for every one of my divs that I add I should create a way for content editors to add that div. so PLEASE hear me out before before telling me I’m doing it all wrong (which someone elses post from a few years back degenerated into)

    I have a website and I’ve built the HTML in an editor. It’s much easier that way and I was writing / designing on the fly, on a limited budget so could not spend the time planning out adding to the default WP editor features.

    This contains code that are basically hooks for CSS to add in call out boxes, pull quotes, columns, change styles etc etc.

    What I’d like to be able to do is simply paste that code into the code view of wordpress. Then if the client has a few typos they can change them in the visual view. If they want to move whole sentences around they’d need to call me and I’d do it – otherwise they could delete end and beginning DIVs.

    The problem is that whenever I have a DIV, WP enteres an empty P.

    Unless I removed all the white space before pasting the code in, is there any way of disabling this. If I disable all <p> then when the client creates posts they would have to add all those by hand.

    Perhaps there is a better way of going about it? Or perhaps its a flat “NO” but I’d appreciated any thoughts on this.

    Maybe I can use remove_filter (‘the_content’, ‘wpautop’) on pages but have it enabled for posts?

    Much appreciated

Viewing 3 replies - 1 through 3 (of 3 total)
  • The wpautop control plugin might be useful.

    You should also look at the CKEditor plugin. Many people find it better than TinyMCE

    Thread Starter mattyk

    (@mattyk)

    Thanks for this – instead of using a plugin I thought I’d look into disabling wpautop for pages only.

    However, strangely adding this gets rid of all <P>s even when I type them in. I’m sure this wasn’t happening yesterday. So if I’m in the code view, I type a <p> around some text, move to visual editor, then back to html editor the <p>s have been stripped. Am I doing something wrong or is this what the wpautop filter does?

    Much appreciated.

    I am not sure why that is happening. I really don’t use TinyMCE very much. I either use CKEditor or add Ultimate TinyMCE.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stop WordPress Messing with code’ is closed to new replies.