• this adds my custom field that shows a detailed receipt after a buyer pays for an item.
    The problem is the textarea doesnt have spacing, it just becomes one big paragraph.

    <?php } else { echo get_post_meta($transaction_childdeal->post_id,'voucher_text',true); }} ?></p>
            <p class="shipping_address">
            <?php { echo get_post_meta($transaction_childdeal->post_id,'inclusions',true); } ?></p>
            <p class="shipping_address">
            <?php { echo get_post_meta($transaction_childdeal->post_id,'conditions',true); } ?></p>

    this is a screenshot result of that code
    https://s8.postimage.org/49w3qyan9/screenshot.jpg
    as you can see the text on terms & conditions is just one big paragraph with no spacing.

Viewing 1 replies (of 1 total)
  • If your field is stored with new lines between each item in the list you could just do this

    <p class="shipping_address">
            <?php { echo nl2br( get_post_meta($transaction_childdeal->post_id,'conditions',true) ); } ?></p>

    I’m not sure how the items are stored so that may not work!

Viewing 1 replies (of 1 total)
  • The topic ‘how to add line breaks for post custom fields’ is closed to new replies.