Use wp_enqueue_style
to add a print stylesheet, note the media
parameter that lets you make it a print-specific stylesheet:
function wpa_print_styles(){
wp_enqueue_style(
'wpa-print-style',
get_stylesheet_directory_uri() . '/print-style.css',
array(),
'20130821',
'print' // print styles only
);
}
add_action( 'wp_enqueue_scripts', 'wpa_print_styles' );
Related Posts:
- What is the difference among col-lg-*, col-md-* and col-sm-* in Bootstrap?
- Set line spacing
- create a white rgba / CSS3
- Using CSS for a fade-in effect on page load
- Transition of background-color
- In CSS what is the difference between “.” and “#” when declaring a set of styles? [duplicate]
- css: how to center box div element directly in center?
- Transitions on the CSS display property
- How to fix a footer overlapping content?
- What is element.style and why is it overriding my css settings?
- What’s the HTML to have a horizontal space between two objects?
- HTML/CSS float: left; is not working properly
- How to get current screen width in CSS?
- margin-right is not working with my HTML. How can I center my content?
- CSS Div width percentage and padding without breaking layout
- CSS div width not working
- Positioning background image, adding padding
- CSS background-image – What is the correct usage?
- Set bootstrap modal body height by percentage
- Click through div to underlying elements
- Responsive iframe with max width and height
- How can I fill a div with an image while keeping it proportional?
- Inner glow effect of button
- Hexagon shape with CSS3
- CSS selector for first element with class
- Remove top admin bar
- How make theme css be first and not plugin css
- One WordPress and database but multiple subdomains
- How can I remove css from a child theme?
- Custom Admin CSS styles to style media uploader?
- getting url in wp_enqueue_style
- Gutenberg Additional CSS Class without modifying theme?
- Add Post Status to Body Class
- Why does my dissappear?
- wp_enqueue_style – CSS Not loading – ERR_TOO_MANY_REDIRECTS [closed]
- Help with child theme enqueuing additional css files
- Bootstrap in theme
- Why does my caroussel gallery do this in responsive? [CSS] [closed]
- Website CSS not loading [closed]
- How to align full div [closed]
- Font Awesome icons disappearing [closed]
- Custom styles dropdown in TinyMCE editor – not working with headings
- Load CSS in footer, like your can with JS?
- Correct Way To Make Changes To A WordPress Theme
- How to change the full capitals font title of my WordPress Blog?
- How to add inline css code with background image in page html code?
- Header background image just stopped working
- Page layout is broken when viewing search results.
- HTML email sent with wp_mail shows plain text
- Style file inclusion
- CSS getting injected into index from somewhere after theme/custom CSS is loaded, overriding all of my CSS [closed]
- How do I change the style of just a part of the tagline?
- Having a hard time linking my css and JS files on a Boostrap to WP conversion
- Apply custom css for user role
- Reduce font size [closed]
- override a css style [closed]
- How to avoid repeating similar properties for all tds of a table in a wordpress post
- Using css class selectors on a specifc page [closed]
- Loading bbPress CSS file only on forum directory
- How can I force the WordPress visual editor to preserve the line breaks after paragraphs?
- How to create CSS Counters for Comments (depth 5)?
- Override All CSS with Custom CSS on a Page by Page Basis
- padding not working
- Hide Some Fields of Post Submit box
- CSS properties in textarea in the Customizer
- Navbar bg to overflow to section below (updated)
- New Styles Not Rendering On Mobile Phone and Tablet
- WordPress default theme CSS version problem and not loading
- Include ElementorPro css into WordPress custom page
- Customizing the CSS for the post/page editor?
- My Child Theme CSS Isn’t Working
- how to modify html on homepage (no home-page.php in my theme)
- how does additional css rendering work?
- Add class when more page is visited
- How do I make a child theme’s style.css load after plugin css?
- WordPress – Portfolio – Change number of items in a row
- Floated element floats into post content in IE, Safari, and Chrome
- I cannot make this position properly in WordPress [closed]
- How can I pass a variable from PHP to LESS?
- Large Unwanted Space at the Bottom of Blog Posts [closed]
- Create a body div using CSS [closed]
- vertical menu bar css
- How would I use a media query to make my entire theme responsive or fluid? [closed]
- Clear white line off page [closed]
- Strange symbols on page [closed]
- I need css code to divide my webpage sections into two columns
- Footer in middle of page in different browers [closed]
- Put CSS on TOP, how?
- I am trying to apply these CSS rules to x3 Post-ID’s but I can’t get it to work – any idea how I can?
- In which file can I find the custom CSS code I entered?
- Some times CSS not Applying
- CSS does not take effects and it doesn’t show in inspect [closed]
- Add Quicksand for mobile devices
- Narrow paragraph block aligned to left of “wrapper”
- Transparent Overlay for Gravity Forms Ajax Spinner
- Remove the main title, but only from the main page
- aos properties ‘invalid’ and not recognised when included as a css class [closed]
- ACF Extended : Disable styles in front [closed]
- Customize margin between paragraphs using the Gutenberg Style editor
- How to remove automatically added custom style tag?