Skip to content

Instantly share code, notes, and snippets.

@michaelcarwile
Last active December 20, 2015 04:29
Show Gist options
  • Save michaelcarwile/6071435 to your computer and use it in GitHub Desktop.
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.
<?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