Created
July 1, 2016 00:30
-
-
Save rgadon107/ceb854afcd0969a8b89adb8e8ea68640 to your computer and use it in GitHub Desktop.
Child theme customizations to the site header area in `header.php`
This file contains hidden or 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 | |
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>', | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.