Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save calliaweb/39efc318f02a2a5ef295735f93bcdae2 to your computer and use it in GitHub Desktop.
Save calliaweb/39efc318f02a2a5ef295735f93bcdae2 to your computer and use it in GitHub Desktop.
Add line break to site description at "--" in Genesis child themes
<?php
add_filter( 'genesis_seo_description', 'jmw_site_description', 10, 3 );
/**
* Add line break to site description at "--" in Genesis child themes
* @link http://www.jowaltham.com/line-break-site-description-genesis
*
* @param string $description The html string that is output as the site description
* @param string $inside The site description in General Settings
* @param string $wrap The html string to wrap around the site description
*
* @return string Modified description
*/
function jmw_site_description( $description, $inside, $wrap ) {
$inside = str_replace( '--', '<br />', $inside );
$description = sprintf( "<{$wrap} %s>", genesis_attr( 'site-description' ) );
$description .= "{$inside}</{$wrap}>";
return $description;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment