Last active
August 29, 2015 14:18
-
-
Save ramiabraham/6e3d8cb9b0f7375a74c7 to your computer and use it in GitHub Desktop.
Minimum Genesis print styles
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
| <?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