Sticky footer

var $ = jQuery;

$(document).ready(function() {
  stickyFooter();

  $(window).resize(function() {
    setTimeout(stickyFooter, 300);
  });
});

function stickyFooter() {
  var windowH = $(window).height();
  var bodyH = $('html body').height();
  var headerH = $('header.site-header').height();
  var footer = $('footer.site-footer');
  var footerH = footer.height();
  var content = $('.site-content');


  if(bodyH < windowH) {
    footer.css({"position" : "absolute", "bottom" : 0, "left" : 0, "right" : 0});
    content.height(windowH - (footerH + headerH));
  } else {
    footer.css({"position" : "relative"});
    content.css({"height" : "auto"});
  }
}