WordPress.org

Support

Support » Themes and Templates » php the_content() in Textarea

php the_content() in Textarea

  • Hi dear I want to show <?php the_content() ;?> in textarea. But when i Use

    <textarea><?php the_content() ;?></textarea>

    its show the code of <?php the_content() ;?> not just content or post.

    Example: Preview

    <p>Hello word Its my first post</p>

    Here i don’t want to show <p> or any html coding in Text area I just want to show Visual base post Any Help..?

Viewing 5 replies - 1 through 5 (of 5 total)
  • It shows that because the the_content() function outputs the content after it’s been processed and filtered. What you want to do is just this:

    <textarea><?php echo $post->post_content; ?></textarea>

    Moderator Jose Castaneda

    @jcastaneda

    I have to ask the question of why you don’t want to show HTML and would rather have it be inside a textarea?

    It’s not that strange. I’ve done it before when I’ve wanted the original text for editing somewhere outside of the “standard” system. Granted, it’s not a common use, but it’s not completely uncommon.

    catacaustic thanks allot dear thanksssssssssssssssssss alooot. You don’t know you solve how much big problem for me.. because I don’t know about php thanks aloooooooooooooooooooooooooooooooot… 🙂

    catacaustic I am here back. Thanks your first response now I am going to bold the text in post and adding the <!—more—> tag in post.. when I add these post then that is showing in Text Area….
    How I can disable all html or php Coding in Text area..?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘php the_content() in Textarea’ is closed to new replies.