Created
April 26, 2019 00:38
-
-
Save seothemes/e41db2a4237a9bb2cc387a8fcaeacbe8 to your computer and use it in GitHub Desktop.
Add hook after title area
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 | |
add_filter( 'genesis_markup_title-area_close', 'prefix_after_title_area', 10, 2 ); | |
/** | |
* Appends HTML to the closing markup for .title-area. | |
* | |
* Adding something between the title + description and widget area used to require | |
* re-building genesis_do_header(). However, since the title-area closing markup | |
* now goes through genesis_markup(), it means we now have some extra filters | |
* to play with. This function makes use of this and adds in an extra hook | |
* after the title-area used for displaying the primary navigation menu. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $close_html HTML tag being processed by the API. | |
* @param array $args Array with markup arguments. | |
* | |
* @return string | |
*/ | |
function prefix_after_title_area( $close_html, $args ) { | |
if ( $close_html ) { | |
ob_start(); | |
do_action( 'genesis_after_title_area' ); | |
$close_html = $close_html . ob_get_clean(); | |
} | |
return $close_html; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment