• OM2

    (@om2)


    I’m trying to include the content of another post
    I’m having trouble ??

    The code I have is

    $post_object = get_post(10);
    // 10 being the the post ID
    
    $post_properly_formatted = '<p>'.format_to_post($post_object->post_content).'</p>';

    I looked at a plugin that inserts posts anywhere you want
    I saw that they used the function format_to_post() and they surrounded the content with <p> tags – so I did the same

    Problem: I’m getting the post content, but it the formatting is incorrect – I am not getting carriage returns ??

    I assume that WP does some formatting somewhere before giving post content

    I assumed this is what the function format_to_post() would do for me?

    It doesn’t seem to have any effect at all

    And there doesn’t seem to be any text guide on the function – nothing is really said on its page

    Help! Where am I going wrong?

    Thanks

    Omar

  • The topic ‘format_to_post() trouble inserting post content’ is closed to new replies.