Created
March 20, 2019 20:32
-
-
Save justingeeslin/6d7f0abd4320d7c1f55db83f00e2ac99 to your computer and use it in GitHub Desktop.
Prep for Print Wordpress Page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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