WordPress.org

Ready to get started?Download WordPress

Forums

textarea in post (13 posts)

  1. umair
    Member
    Posted 7 years ago #

    hey guys !!!
    i wanna add a text area with some contents displayed in the contents of a post. how can that be accompalished ??

  2. peiqinglong
    Member
    Posted 7 years ago #

    What do u mean add a text area with some content?

    You could just go to the html editor and do:
    <textarea>some stuff.</textarea> and see if that does what you want...probably will have to style it.

  3. umair
    Member
    Posted 7 years ago #

    of ! that was ok for me

  4. peiqinglong
    Member
    Posted 7 years ago #

    So it worked for what you wanted?

  5. bigmm
    Member
    Posted 7 years ago #

    This has been a problem for me ever since I started using wordpress almost 2 years ago. No matter what version I have running, the codes inside the text area box are always garbled after I publish, and forget about running two textarea boxes simultaneously. The first box is never closed correctly, forcing all content after the box tbe treated as if it were part of it... even completely separate posts fall prey to being included into the text box. Not only that, if I have certain code that needs to have a break in it, wordpress automatically adds a break, making it useless to my visitors.

    I tried everything, converting forward and slashes into HTML code, putting them in DIV layers..

    The only thing that works is putting the boxes into a separate HTML page and including it as an Iframe into my posts, which is a pain.

    It seems like a simple thing to do, considering I have seen textareas be used in posts before without any problem. Does anyone know definitively how to put a text area into a wordpress post or page?

  6. howellalexander
    Member
    Posted 6 years ago #

    This has been listed as a bug for the last three months (http://trac.wordpress.org/ticket/4645) and for me it rules out WP as a CMS entirely, partyle because I need to use <textarea> and partly because it makes me wonder what other basic tag filtering isn't being done, and the problems that might cause in the future.

    I'll poke about in the source and see if a hack can be shunted together.

  7. moshu
    Member
    Posted 6 years ago #

    Just kill the wysiwyg gizmo and you can type any kind of html code.

  8. howellalexander
    Member
    Posted 6 years ago #

    Fancy pointing us to the plugin which disables the gizmo? Can't find any nice way or ripping it out myself.

  9. jrrl
    Member
    Posted 6 years ago #

    Just go to your profile (link in the upper right of your admin interface) and there is a check box to disable the wysiwyg editor.

  10. aprilpoe
    Member
    Posted 6 years ago #

    HELP! I am trying to make a textarea on my blog that contains a video from youtube. when the blog is saved it strips the youtube code out of it. I am trying to post the video, and underneath it have a text area with the video code in it.

  11. aprilpoe
    Member
    Posted 6 years ago #

    i have tried this with and without the wysiwyg editor

  12. jrm213
    Member
    Posted 6 years ago #

    hmmm...
    From what I can tell the problem is that the wordpress GUI is displaying the post code in a textarea. The wordpress gui or the browser is ending the containing textarea when it sees </textarea>. So the rest of your post ends up actually as part of the gui and not part of your post anymore.

    That is quite annoying.

    In any case it "WILL WORK" as long as you never need to edit the post/page again. Which is highly unlikely.

  13. jrm213
    Member
    Posted 6 years ago #

    Ok I made a workaround for this. If someone sees a reason that this shouldn't be done please let me know. Seems to work well so far.

    I added <endtextarea> anywhere I really wanted </textarea> in my page.

    Then I added a custom filter to the_content by opening functions.php in my theme and adding the following function and line of code provided by Otto42 in post http://wordpress.org/support/topic/107990?replies=10 to the top. Now my textareas work fine when viewing the page and when editing the page.

    function replace_content($content)
    {
    $content = str_replace('<endtextarea>', '</textarea>',$content);
    return $content;
    }
    add_filter('the_content','replace_content');

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags