Adding specific HTML to every page on a site
-
I have a requirement to add a specific piece of HTML to every page of a web, irrespective of the template. This purpose is to enable the visitor to add or remove their email address which feeds a “live” MySQL database server-side (in this instance) but could be any code snippet and it may not be restricted to HTML.
Since WordPress has a range of pages is it achievable, say, to add the code to the header so it seems to appear below whatever the header is and above the page content?
I’m guessing that if my thoughts are correct then the code would need to be pasted in header.php but not knowing PHP yet I am unsure as to the insertion point.
Using Twenty Twelve as a guide to where would I add such code?
Would it be appropriate to use a child of header.php (assuming my thinking is sound).
Example code (not yet final but the structure is indicative) is shown below: –
<center>
<form action=’https://hosting.heartinternet.co.uk/list.cgi’ method=’post’>
<input type=’hidden’ name=’list’ value=’Groups’/>
<input type=’hidden’ name=’redirect-success’ value=’https://www.eastcommunitytransport.co.uk/complete.html’/>
<b>Our Mailing List</b>
<input type=’text’ name=’email’/>
<input class=’radio’ type=’radio’ name=’action’ value=’add’ checked=’checked’/>Subscribe
<input class=’radio’ type=’radio’ name=’action’ value=’delete’/>Unsubscribe
<input type=’submit’ value=’Do it Now!’/>
</form>
</center>
- The topic ‘Adding specific HTML to every page on a site’ is closed to new replies.