Forums

[resolved] Remove html tags from content (3 posts)

  1. ashishbajaj
    Member
    Posted 3 years ago #

    Hi i am trying to remove html formating from the content.

    am using the following code

    <?php
    
    $string1 = the_content();
    $string = strip_tags($string1);
    
    echo $string ;
    
    ?>

    how ever this is not working for me.

    when i echo the content it shows up as <p> text text </p>

    i want to remove the <p> </p> tags from the content.

    How can i do this.. please advise.

    Thanks in Advance. !!

  2. ashishbajaj
    Member
    Posted 3 years ago #

    Hi i resolved it from another post. here

    we got to use get_the_content();

    instead of the_content();

  3. esmi
    Theme Diva & Forum Moderator
    Posted 3 years ago #

    What about trying:

    $string1 = get_the_content();
    $string = strip_tags($string1);

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.