I need to add some html into the header.php but instead of directly changing the header.php of my theme or creating a child theme, how can I do it with just actions and/or hooks?
It all depends upon the theme, what you want to change, and if WordPress and/or the theme provide filters and hooks to accomplish it. A child theme would most likely be your best (and safe) bet.
A simple child theme is very easy to setup and code. Take a look at he CODEX docs here.
If you are looking to insert code into the
If that's not the case, then it's more difficult. I think it would depend on the theme providing a hook at your desired point of insertion.
Another option is to make DOM manipulations with jQuery.
Other quite crazy possibilities can be extracted from this Q&A: Adding onload to body
You have two options:
say in header.php I have a large blue square containing a message, and I want to eb able to insert stuff afterwards via a hook, I can do:
I can now put in functions.php something like this:
And hello world will be displayed after the big square message
Of course you will need to add the