My First WordPress Plugin
I wrote my first plugin for WordPress a couple of days ago, it was a very simple plugin. All I wanted to do was to insert a few lines of javascript - Google Analytics javascript - to the bottom of each page here.
Since GIDBlog.com is a blog hosting site, and there are always multiple themes, or WordPress templates, to choose from, adding (pasting) lines of javascript directly into the theme files seemed like an insane idea.
I don’t know much about WordPress and I am still figuring things out, but this is what I did to get the Google Analytics code to show on every page.
Here is a copy of the plugin script.
Unlike regular WordPress plugins though, this one needs to be inside the wp-content/mu-plugins/ folder.
I would like to thank cableguy, once again, for all the pointers! ![]()
Hmm, still having problems with this. How do I actually add the code? When I try to access the /mu-plugins folder, I get a “404 Not Found” error. I’ve looked around the Admin section but I can’t find anything for true site management.
Comment by crystalattice — May 15, 2007 @ 5:25 am