fogster
Member
Posted 16 years ago #
I'd like to include some JavaScript tracking code on every page served up, across multiple blogs. Right now it's just a bit of JavaScript (for Google Analytics), though I might be interested in including some PHP logic at some point.
Is there a way I can cause this to happen globally on a WPMU installation? I'm not sure if a simple plugin would work, as it'd still have to be enabled per blog.
fogster
Member
Posted 16 years ago #
(FWIW, after hitting post here, I got a "Topic not found" error, but it obviously posted anyway)
A simple plugin is exactly how it works, and you hook in the wp_footer call, which shows up in pretty much every theme.
http://wpmututorials.com/plugins/how-to-hook-into-the-footer/
that's very simple.
first you need a hook:
add_action('wp_footer', 'my_function', 10);
Now, you have do define your function:
function my_function() {
//...
echo "Hello To All Blogs!
";
//...
}
Have fun!