I recently had a Genesis WordPress project where I needed to add a span tag to the site description (tagline). The Studeopress website explains how to modify the Site Title with a filter but does not explain how to modify the Site Description (Tagline).The Tagline is the text you enter in the Tagline field in the WordPress General Settings. In my case, I needed to have two colors in the tagline. To do this, I used the genesis_seo_description filter to add span tags and additional text to the tagline.
// Modify site description add_filter('genesis_seo_description', 'sp_seo_description', 10, 3); function sp_seo_description($description, $inside, $wrap) { $inside = sprintf( '%s...<span>With Menus To Fit Your Wishes and Budget</span>', esc_attr( get_bloginfo('description') ), get_bloginfo('description') ); $description = sprintf( '<%s class="site-description">%s</%s>', $wrap, $inside, $wrap); return $description; }
The image above illustrates my modification: I added <span>With Menus To Fit Your Wishes and Budget<span> so I could use two colors in the tagline.
Same with the site title. Below is the code to modify the site title:
// Modify site title add_filter('genesis_seo_title', 'sp_seo_title', 10, 3); function sp_seo_title($title, $inside, $wrap) { $inside = sprintf( '<a href="/" title="%s">%s</a><span>Custom Catering</span>', esc_attr( get_bloginfo('name') ), get_bloginfo('name') ); $title = sprintf('<%s class="site-title">%s</%s>', $wrap, $inside, $wrap); return $title; }
Leave a Reply