You can place the invocation code anywhere it makes sense to place it. Do this via a hook. I place mine in the "global_start" hook.
Then, you place the variable created by the invocation code, wherever you like. Header is fine. If you user the variable within a template used by a function (like the postbit template), you'll first have to declare the variable as global, also via the appropriate hook.
I explain all this in the link I provided.
|