{"id":150,"date":"2020-01-19T15:24:02","date_gmt":"2020-01-19T15:24:02","guid":{"rendered":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.oxyset.com\/?p=150"},"modified":"2022-05-13T19:59:48","modified_gmt":"2022-05-13T19:59:48","slug":"register-print-css","status":"publish","type":"post","link":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/register-print-css\/","title":{"rendered":"Register Print CSS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">after the file path add array, version and then print<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\"><pre class=\"wp-block-cedaro-code line-numbers\"><code class=\"language-php\">&lt;php\nwp_enqueue_style( 'print_css', plugin_dir_url( __FILE__ ) . 'assets\/css\/print.css', array(), '1.0.0', 'print' );<\/code><\/pre><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">An entire block stored in function.php should look like this. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can always add it as <code>@media print<\/code> but with this you will have much more flexibility and load it where you need it.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\"><pre class=\"wp-block-cedaro-code line-numbers\"><code class=\"language-php\">&lt;php\n\/\/ Styles\nfunction theme_styles() {\n    wp_enqueue_style( 'print_css', plugin_dir_url( __FILE__ ) . 'assets\/css\/print.css', array(), '1.0.0', 'print' );\n}\nadd_action( 'wp_enqueue_scripts', 'theme_styles',  1000, 1 ) ;\n<\/code><\/pre><\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">More about Print CSS:<br><br><a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/www.sitepoint.com\/css-printer-friendly-pages\/\">https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/www.sitepoint.com\/css-printer-friendly-pages\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/www.smashingmagazine.com\/2018\/05\/print-stylesheets-in-2018\/\">https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/www.smashingmagazine.com\/2018\/05\/print-stylesheets-in-2018\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>after the file path add array, version and then print An entire block stored in function.php should look like this. You can always add it as @media print but with this you will have much more flexibility and load it where you need it. More about Print CSS: https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/www.sitepoint.com\/css-printer-friendly-pages\/ https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/www.smashingmagazine.com\/2018\/05\/print-stylesheets-in-2018\/<\/p>\n","protected":false},"author":1,"featured_media":46517,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"slim_seo":{"title":"Register Print CSS - Code DPlugins","description":"after the file path add array, version and then print An entire block stored in function.php should look like this. You can always add it as @media print but wi"},"_slim_seo_primary_term_category":0,"_slim_seo_primary_term_post_tag":0,"footnotes":""},"categories":[3],"tags":[],"dpc_library":[],"class_list":["post-150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/comments?post=150"}],"version-history":[{"count":0,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/posts\/150\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media\/46517"}],"wp:attachment":[{"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/media?parent=150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/categories?post=150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/tags?post=150"},{"taxonomy":"dpc_library","embeddable":true,"href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/code.dplugins.com\/wp-json\/wp\/v2\/dpc_library?post=150"}],"curies":[{"name":"wp","href":"https:\/\/summer-heart-0930.chufeiyun1688.workers.dev:443\/https\/api.w.org\/{rel}","templated":true}]}}