WordPress does not accept div tag

  • Author
    Posts
  • #317595

    raul008
    Member

    WordPress do not accept DIV Tag on my blog :|

    #317892

    devblog
    Member

    bummer!

    #317895

    Paste the code here in the forum between backticks (the key to the left of the #1 with the ~ on it). WordPress will indeed strip some div code that is not allowed, but we cannot tell if we cannot see it.

    #317897

    raul008
    Member

    The code no have errors! A few minutes the code are accept, now no accept :(

    #317901

    raul008
    Member

    The sidebar not accpet the div, but the pages accept :|

    #317905

    WordPress is obviously rolling out some new code for new features and bug fixes and when that happens, there can be glitches. My only suggestion is to give it some time for things to settle down.

    #317913

    raul008
    Member

    But in WordPress FAQ have a information of accept tags and list div tag!

    #317930

    bubel
    Staff

    We are currently looking into some issues with recent code changes. I will post back when a fix is in place.

    #318024

    raul008
    Member

    The WordPress fixed this bug, thanks!

    #318044

    rybaxs
    Member

    Did they fixed raul008? when?

    < div > was change into <p > .. others are gone.. :(

    #318045

    rybaxs
    Member

    Hi raul008..
    try this..

    ——————

    2.1 version tinyMCE will replace <div> by <p> when saving post, you may change this by hacking file: wp-includes/js/tinymce/tiny_mce_config.php
    about 24th line, find:
    $valid_elements = ‘p/-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘;

    replace by:
    $valid_elements = ‘-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘;

    ——————

    ‘p/-div[*] to ‘p[*],-div[*]

    ‘-’ means remove empty elements
    ‘p/div’ means replace div by p
    ‘[*]‘ means any attribute allowed

    source: http://blog.mcstudios.net/2007/03/19/fixing-wordpress-editor-removing-div-tags

    #318048

    1tess
    Moderator Emeritus

    rybaxs
    At wordpress.com we have no access to php
    The blog linkded to your name is at Blogger.

    https://en.forums.wordpress.com/topic/please-read-me-first-before-posting?replies=1

    #318050

    rybaxs
    Member

    Div will work at the first save of your code.. but if you open it again the <div> tag will be gone. but try to save it at once, it works..

    #318051

    dlager
    Member

    As 1tess says this is the WordPress.com forum, so you advice won’t work, rybaxs, thank you though. strings are stripped out here.

The topic ‘WordPress does not accept div tag’ is closed to new replies.