Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@seothemes
Created April 26, 2019 00:38
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 seothemes/e41db2a4237a9bb2cc387a8fcaeacbe8 to your computer and use it in GitHub Desktop.
Save seothemes/e41db2a4237a9bb2cc387a8fcaeacbe8 to your computer and use it in GitHub Desktop.
Add hook after title area
<?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