Skip to content

Instantly share code, notes, and snippets.

@justingeeslin
Created March 20, 2019 20:32
Show Gist options
  • Save justingeeslin/6d7f0abd4320d7c1f55db83f00e2ac99 to your computer and use it in GitHub Desktop.
Save justingeeslin/6d7f0abd4320d7c1f55db83f00e2ac99 to your computer and use it in GitHub Desktop.
Prep for Print Wordpress Page
// Remove WordPress Print styles
document.querySelector('link[media="print"]').remove()
// Remove the site header and nav
document.querySelector('header').remove()
// Change page name, About, to my name.
document.querySelector('h1').textContent = "Justin Geeslin";
// Remove the margin from the paragraph preceding list of one bullet
document.querySelector('h3:nth-of-type(2) + p').style.margin = 0;
// Turn down for print
document.querySelector('body').style.fontSize = '0.9em';
// Hide things
var toHide = [
'#jp-post-flair',
'#secondary',
'footer'
];
toHide.forEach(function(item) {
// Did I say hide? I meant remove..
document.querySelector(item).remove()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment