Skip to content

Instantly share code, notes, and snippets.

@ramiabraham
Last active August 29, 2015 14:18
Show Gist options
  • Select an option

  • Save ramiabraham/6e3d8cb9b0f7375a74c7 to your computer and use it in GitHub Desktop.

Select an option

Save ramiabraham/6e3d8cb9b0f7375a74c7 to your computer and use it in GitHub Desktop.
Minimum Genesis print styles
<?php
/**
* Minimum Genesis print styles
* Can be added via an @media print media query,
* or by enqueueing a print-style
* /
// Remove the media query wrapper if enqueueing a print style separately.
@media print {
* {
display: none;
}
article.post,
article.post * {
display: block;
}
}
/**
* One option of a link to add,
* hooked on genesis_after_entry
* or wherever you'd like
*/
function ra_print_link() {
return '<a href="javascript:window.print()">Print</a>';
}
add_action( 'genesis_after_entry', 'ra_print_link', 99 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment