How to add a new div in the header?
-
I need to make a small structural change to the header by adding an additional div between the hgroup-wrap div and the page-title-wrap div.
This is super easy if I hack the inc/structure/header-extensions.php file… At line 835 I pasted this:
<!--Custom theme hack to insert the featured image as header for the page --> <?php if ( !is_single() ) { echo ' <div class="featured-header-wrap"> '; if ( has_post_thumbnail() ) {the_post_thumbnail();} echo '</div>'; } ?>
However I would like to do it the proper way.
I tried recreating the inc/structure/ directory in my child theme and pasting a modified header-extenstions.php file there and tried pasting it in the root of my child theme. That didn’t work.
I also tried unhooking the entire interface_headercontent_details() function and re-hooking my own version in my child theme’s functions.php. Like this:
remove_action( 'interface_header', 'interface_headercontent_details', 10 ); add_action( 'interface_header', 'my_interface_headercontent_details', 12 );
However, this landed up creating two headers…
Does anyone have any ideas how to do this?
Thanks!
AJ
- The topic ‘How to add a new div in the header?’ is closed to new replies.