Skip to content

Instantly share code, notes, and snippets.

@michaelcarwile
Last active December 20, 2015 04:29
Show Gist options
  • Save michaelcarwile/6071485 to your computer and use it in GitHub Desktop.
Save michaelcarwile/6071485 to your computer and use it in GitHub Desktop.
Add line breaks in WordPress site description of Genesis child theme by using commas, then using PHP preg_replace to replace commas with line breaks in site description.
<?php
// don't copy php tag
// genesis replace default description with description containing line breaks
remove_action( 'genesis_site_description', 'genesis_seo_site_description' );
add_action( 'genesis_site_description', 'child_seo_site_description');
function child_seo_site_description() {
$blogdesc = get_bloginfo('description');
$blogdesc = preg_replace("/, */", "<br>", $blogdesc); ?>
<p id="description"><?php echo $blogdesc; ?></p>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment