Last active
December 20, 2015 04:29
-
-
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.
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 | |
// 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