I know there is going to be an easy way to do this but I just can’t seem to find the best practice for the following;
I have a plugin which when complete should generate HTML on every page, I want it to do this without the need for JavaScript and I want it to be independent of the theme when possible.
It will appear on every single page, so it can’t be a shortcode in a template file (but would a shortcode in the header.php file be appropriate?).
Ideally there would be a hook that would allow me to insert code after the <h1>
tag in the header (don’t think it will be just that easy though!)
Could someone point me in the right direction or send me some pseudocode to help me on my way?
Edit
Brian asked me What exactly are you trying to insert and where on the template, here is my answer;
It will be a element styled from within the plugin with an options value generated by the plugin. It will be appearing at the top right of every page, in the header of the page.
Use
the_content
orthe_title
/single_post_title
(?) filter and simply prepend/append what you need. Also take a look at the Action/Filter API Reference.@Example: