• Resolved PickleEater

    (@pickleeater)


    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&#8217; method=’post’>
    <input type=’hidden’ name=’list’ value=’Groups’/>
    <input type=’hidden’ name=’redirect-success’ value=’https://www.eastcommunitytransport.co.uk/complete.html’/&gt;
    <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>

Viewing 1 replies (of 1 total)
  • Thread Starter PickleEater

    (@pickleeater)

    A rhetorical answer…

    Just pasted the code into header.php and it works perfectly. The code example is specific to one mailing list on the domain.

    I’m sure it will also work on child pages but I’ve yet to study this aspect in detail.

Viewing 1 replies (of 1 total)
  • The topic ‘Adding specific HTML to every page on a site’ is closed to new replies.