Make WordPress Core

Changes between Initial Version and Version 4 of Ticket #40508


Ignore:
Timestamp:
05/30/2017 08:04:30 PM (8 years ago)
Author:
desrosj
Comment:

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' );

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #40508

    • Property Focuses template added
    • Property Component changed from General to Themes
    • Property Version changed from trunk to
    • Property Keywords needs-patch reporter-feedback added
    • Property Type changed from defect (bug) to enhancement
  • Ticket #40508 – Description

    initial v4  
    3737}}}
    3838
    39 
     39I'll get a patch made soon.