Last active
December 20, 2015 04:29
-
-
Save michaelcarwile/6071435 to your computer and use it in GitHub Desktop.
Add line breaks in WordPress site description by using commas, then using PHP preg_replace to replace commas with line breaks in site description.
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 | |
// don't copy php tag | |
// replace commas in description with line breaks | |
$blogdesc = get_bloginfo('description'); | |
$blogdesc = preg_replace("/, */", "<br> ", $blogdesc); | |
echo $blogdesc; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment