Skip to content

Instantly share code, notes, and snippets.

@sirchrispy
Created March 1, 2017 23:34
Show Gist options
  • Save sirchrispy/230d661ebb4f0e31ff167a95c77454af to your computer and use it in GitHub Desktop.
Save sirchrispy/230d661ebb4f0e31ff167a95c77454af to your computer and use it in GitHub Desktop.
WordPress MultiSite and Genesis: Change Site Descriptions to Main Site Description
<?php
// Change header description for sub-sites to main site's description
add_filter( 'genesis_seo_description', 'tcd_change_header_description', 10, 3);
function tcd_change_header_description( $description, $inside, $wrap ) {
if ( is_main_site() ) {
$inside = esc_html( get_bloginfo( 'description' ) );
} else {
switch_to_blog(1);
$inside = esc_html( get_bloginfo( 'description' ) );
restore_current_blog();
}
return sprintf( "<{$wrap} %s>%s</{$wrap}>", genesis_attr( 'site-description' ), $inside );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment