Here is a JS way to do it: (with code taken directly from this answer):
Create a javascript file: footerheader.js
Give it the content:
document.getElementById("myHead").innerHTML =
"<span id='headerText'>Title</span>"
+ "<span id='headerSubtext'>Subtitle</span>";
document.getElementById("myFooter").innerHTML =
"<p id='copyright'>Copyright © " + new Date().getFullYear() + " You. All"
+ " rights reserved.</p>"
+ "<p id='credits'>Layout by You</p>"
+ "<p id='contact'><a href='mailto:you@you.com'>Contact Us</a> / "
+ "<a href='mailto:you@you.com'>Report a problem.</a></p>";
All this code, you can replace with your own names and ids.
Then your html:
<header id="myHead"></header>
<h3>content</h3>
<footer id="myFooter"></footer>
<script src="footerheader.js"></script>
With the same ids
across all webpages, and the same script included, you can achieve this.