Skip to content

Instantly share code, notes, and snippets.

@rgadon107
Created July 1, 2016 00:30
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 rgadon107/ceb854afcd0969a8b89adb8e8ea68640 to your computer and use it in GitHub Desktop.
Save rgadon107/ceb854afcd0969a8b89adb8e8ea68640 to your computer and use it in GitHub Desktop.
Child theme customizations to the site header area in `header.php`
<?php
namespace albemishpc\header;
/**
* Customizations to the site header area within the Utility Pro child theme.
*
* @package Utility Pro\header
*
* @since 1.0.0
*
* @author Robert A. Gadon
*
* @link http://spiralwebdb.com
*
* @license GNU General Public License 2.0+
*/
add_filter( 'genesis_seo_title', __NAMESPACE__ . '\filter_after_site_title' );
/**
* Filter the site title to add an icon or logo after the site name.
*/
function filter_after_site_title( $html ) {
$site_name = get_bloginfo( 'name' );
$new_html = $site_name . '<span class="site-title-icon"><i class="fa fa-balance-scale" aria-hidden="true">';
$new_html .= '</i></span>';
return str_replace( $site_name, $new_html, $html );
}
add_action( 'genesis_after_header', __NAMESPACE__ . '\render_utility_bar_after_header' );
/**
* Display content for the "Utility Bar After Header" section.
*
* @since 1.0.0
*/
function render_utility_bar_after_header() {
genesis_widget_area( 'utility-bar-after-header',
array(
'before' => '<div class="utility-bar-after-header"><div class="wrap">',
'after' => '</div></div>',
)
);
}
@rgadon107
Copy link
Author

rgadon107 commented Jul 1, 2016

Initial commit. File contains a filter to add a FontAwesome icon after the site title, and register a widget area to the genesis_after_header event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment