Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other comment content

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #203256
    mkdesign82
    Participant

    I’m working on a wordpress website right now and I have this problem .

    Here is the problem:

    When the user type something in comment textarea and use one of those texteditor objects(justifyLeft ,justifyRight ,direction) and post the comment to me , I cant see any thing except the text it self surrounded by span like this .

    (i’ve forget to tell this …
    user not typing the text directly into the textarea he/she type something into a div element which will be converted into html and write down into a textarea by a javascript function.)

    So this code below show in textarea

    <p style="text-align:left;direction:ltr;">
    <span style="line-height: 1.8em; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;">echo hello world</span></p>

    but when the user post the comment I can see only echo hello world surrounded by span

    <span>echo hello world</span>

    and the rest of the tags disappeared.

    But if I login into my website and comment the exactly above tag , it’ll show as it should to be with no problem , I wonder why that happen to users not to admin ?

    im sorry for my bad grammer .

    #203343
    Ilan Firsov
    Participant

    WordPress by default strips almost all HTML code from comments and as far as I know as an admin you are not bound to this restriction and can post HTML.
    If you are working on your own theme or a child theme you can add a filter to the function.php file (though I’d advise you to put it in a theme ‘functionality’ plugin) to allow specific set of HTML tags example to allow pre tag

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘Other’ is closed to new topics and replies.