Support » Fixing WordPress » WP 2.1 – Posting Problem

  • I have no idea,
    is this a bug or there is something wrong with the way I post a news.

    I try to insert this code somewhere between my post:

    <div class=”blablabla”><hr /></div>

    And, when I saw the result with browser, my Tidy plugin give me a warning alert. There is something wrong with my tag, unneeded <p> tag without closing </p> tag.

    <div class=”blablabla”><hr /><p></div>

    And then, I try to fix my post which contain unneeded <p> tag. But, I found more weird result with my post that I’m going to edit (i’m using code tab – not visual).

    the code become: <p class=”blablabla”><hr /></p>

    now, that is not funny 😀

    I’ve done enough test about this problem,
    and I’m pretty sure that there is something wrong.
    Sometimes it is ok, sometimes it isn’t.

    Now, I don’t want to edit my post again – it show me the correct code now.

Viewing 15 replies - 16 through 30 (of 37 total)
  • saphod



    Thank you very much for this fix, it works fine with my WP 2.1.3!

    This was SO annoying!


    mmwp99, thanks for the tip about clearing my browser cache! I couldn’t figure out why this wasn’t working.

    I changed the tiny_mce_config.php as directed above, and this solved my problems.

    I couldn’t find the offending code in formatting.php. Maybe it’s been removed in version 2.2.1 (my current install)

    It would be nice if WordPress didn’t change code! This reminds me of using FrontPage back in 1999, when it would attempt to fix things that didn’t need fixin’.

    Changing the tiny-mce_config.php file as suggested has also fixed the problem for me but . . .

    . . . in doing so, it’s disbled me having the ability to use the Rich Text Editor. The RTE just doesn’t appear now when I select a page to edit.

    Now I don’t personally need the RTE, but I’m creating a site using WP as a CMS and need to have other people (with no html knowledge whatsoever) be able to use the RTE to edit pages in the future.

    Has anyone else encountered this?

    p.s. I’m using WP version 2.2.1

    Furthermore . . .

    I went back and changed the tiny_mce_config file back to haw it was before and it didn’t bring back the RTE, neither did restoring my database in phpMyAdmin.

    Okay – I have the RTE back now after downloading a completely new file, but I’m back to have the same issue with WP changing the <div> to <p>


    Try using a <span> tag. Similar to the <div> and it doesn’t get parsed out.

    I went ahead and removed a lot of the other replacement crap too.

    Did it even occur to the guy who wrote it that some people might not be using Html, xHtml but instead xml and any sort of goof off like that would result in imediate browser error. Sheesh.~

    It must be really hard to put a damn on/off switch somewhere for this kind of time consuming cursed “feature”.

    I tried removing the undesirable code from the tiny_mce_config.php file (on the latest WP version), and while it worked, I lost edit controls. Meaning, I can’t use the included edit features, like Add Link, Bold, Paragraph, or even get to the code source editer. Anybody have a solid solution for the newer WP installations ’cause I think most of the code above was for older versions.

    This code replacement thing is really killing me. How dare they replace my code, I know what I is doing. Dang.

    Any help would be nice.


    Oh yeah, I’m using version 2.2.1


    Can someone help? All I want is <div class=””> or <div id=””> or <p class=””> or heck, even <p id=””>

    I’ve made the changes mentioned above to formatting.php and tiny_mce_config as well as adding

    ‘div’ => array (‘class’ => array ()),
    ‘p’ => array (‘class’ => array ()), etc to $allowedposttags and $allowedtags in kses.php…but nothing… anyone else have this issue? And a fix?




    Solved the problem I was having. I downloaded the latest kses file
    added ‘class’ => array() to the div and p array and its working in case anyone else has a similar problem with class in the p and div tag


    Hey apertureboy,

    What version of WP are you using? I want to give that hack a shot. I guess you’re now able to drop in div tags and not have it rewritten by WP?


    Hey JHouse

    Actually Im using Wordpres mu 1.25a. For one install I used the 2 above mentioned hacks and then the latest kses file with class and id added to the arrays. For another install I just replaced the kses file with the new version and added class and id to the arrays and that allowed class and id in divs and p tags


    Awesome. Thanks for the info. I’m gonna give the kses file hack a shot.

    Thanks again.

    This problem with TinyMCE eating div tags is all over the support forum.

    But there is a way to keep using the visual editor and make things work better–use a plugin like quicktags or write a set of replacement functions to provide formatted div code in your theme’s functions.php.

    I did the latter for my rounded corners inside wordpress posts article…

Viewing 15 replies - 16 through 30 (of 37 total)
  • The topic ‘WP 2.1 – Posting Problem’ is closed to new replies.