This would be very helpful.
I have a child theme that uses a framework. Currently, the only way to include the additional markup that I need would be to override the file in the header.php
child theme.
Ideally, I would like to add a function to an action hook to include this additional markup to prevent overriding the entire template file.
function my_additional_markup( $template_slug ) {
?>
<div>my additional stuff</div>
<?php
// Could also include a template part
if ( 'additional-header-type' === $slug ) {
get_template_part( 'additional_template', 'slug' );
}
}
add_action( 'after_get_header', 'my_additional_markup' );