Support » Themes and Templates » Textarea Tag and Displaying HTML

  • Hi guys. I am setting up my new blog and want to use <textarea> to make a box for each story. I did this and it looked great…well, great except that the content of the textarea displays as plain text and not html formatted text.
    Now according to
    no tags are allowed within the <textarea></textarea> tags. So I may be out of luck.
    Here is what I changed in my index.php:
    <div class=”storycontent”>
    <textarea rows=”30″ cols=”80″ style=”line-height: 100%; text-align: Justify; border-style: inset”>
    <?php the_content(); ?>
    The results look great except for the textarea displaying as text.
    How can I achieve the textarea result and still have the html display properly? Am I out of luck?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Mark (podz)


    Support Maven

    Could you use


    textarea is an input so not remotely applicable for your usage. Why not just leave the content within the storycontent div and style that appropriately?
    You can style a div to look like a default textarea and similarly you can style a textarea to look like any other element on a page, basically you can make them look however you want. You just have to use the right element for the job semantically, as it appears to just be a styling job then a div should be fine, just add the appropriate css.

    Care to take a stab at the CSS edit? I tried but to no avail.
    Index.php –
    <div class=”storycontent”>
    <?php the_content(); ?>
    I looked in wp-layout.css and print.css and did not see storycontent defined.
    Would something like this do the CSS trick?
    #storycontent textarea {
    background: #fff;
    border: 1px solid #333;
    padding: .2em;
    Also, I am going to try the blockquote idea. Liked that one.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Textarea Tag and Displaying HTML’ is closed to new replies.