Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created Sep 25, 2015
Embed
What would you like to do?
<?php
/**
* Add Site Description to Title
*
*/
function be_desc_in_title( $title, $inside, $wrap ) {
$inside = '<a href="' . home_url() . '">' . get_bloginfo( 'name' ) . ' <span class="desc">' . get_bloginfo( 'description' ) . '</span></a>';
//* Build the title
$title = genesis_html5() ? sprintf( "<{$wrap} %s>", genesis_attr( 'site-title' ) ) : sprintf( '<%s id="title">%s</%s>', $wrap, $inside, $wrap );
$title .= genesis_html5() ? "{$inside}</{$wrap}>" : '';
return $title;
}
add_filter( 'genesis_seo_title', 'be_desc_in_title', 10, 3 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment