Forums

[resolved] $post->post_content; with formatting? (2 posts)

  1. Jenst
    Member
    Posted 4 years ago #

    I need multiple the_content(); tags. Is there a way to get the_content(); as a string? That way I could create unique strings for the_content();.

    I have found the $post->post_content; but that only give me the raw text without the text formatting tags.

    I have tried gobal $content; echo $content; but that don't seems to work.

    I know there are filters and hooks but changing the_content() does not work for me, because I need to create multiple versions / strings / the_content() for different posts.

    Possible solutions:
    1. Give me a string that contains the_content(); with text formatting.
    2. Give me a good way with hooks / filters to create multiple the_content() tags.
    3. Give me an SQL query that solves this.
    4. Give me a plugin that makes this possible.

    Help! Thanks in advance!

  2. area381
    Member
    Posted 3 years ago #

    Hi Jenst,

    Not sure if you have found the solution yet. Anyway, the solution is:


    echo apply_filters('the_content', $post->post_content);

    Hope this helps :).

Topic Closed

This topic has been closed to new replies.

About this Topic