WordPress.org

Ready to get started?Download WordPress

Forums

php the_content() in Textarea (6 posts)

  1. Asif Mushtaq
    Member
    Posted 1 year ago #

    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..?

  2. catacaustic
    Member
    Posted 1 year ago #

    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>

  3. Jose Castaneda
    Member
    Posted 1 year ago #

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

  4. catacaustic
    Member
    Posted 1 year ago #

    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.

  5. Asif Mushtaq
    Member
    Posted 1 year ago #

    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... :)

  6. Asif Mushtaq
    Member
    Posted 12 months ago #

    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..?

Topic Closed

This topic has been closed to new replies.

About this Topic