In a WordPress plugin, how do you output HTML code inside the DOM header? [closed]

You can add html to the site head using this function:

// Add scripts to wp_head()
function add_head_html() { ?>
    <!-- html goes here -->
    <?php }
    add_action( 'wp_head', 'add_head_html' );

But if you’re talking about the html element <header> (as it sounds like from your edits) it sounds like overcomplicating things, but you might want to look at injecting it with jquery into the right spot using a solution such as this:
https://stackoverflow.com/a/9866637/3387817

Leave a Comment