Last active
July 5, 2021 09:02
-
-
Save iftee/84f76676415a1bd75fdd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Line break in WordPress meta box text area: the CSS way | |
*/ | |
?> | |
<p class="whitespace"> | |
<?php echo esc_html( get_post_meta( get_the_ID(), 'my-meta-field', true) ); ?> | |
</p> | |
<style> | |
.whitespace { | |
white-space: pre-wrap; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment