When writing PHP templates for WordPress pages we shouldn’t use the <body>
tag because it already exists in header.php
which is called in the template.
How than can we use the onLoad
event within the template?
Since I’m writing more than one template I can’t use it in header.php
.
Don’t attach it via the HTML attribute.
Attach it via an non obtrusive event handler. Because WordPress uses jQuery, that’s as easy as…