Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewlimaza/8fdeaab108294fc86690c83ae9ddaef0 to your computer and use it in GitHub Desktop.
Save andrewlimaza/8fdeaab108294fc86690c83ae9ddaef0 to your computer and use it in GitHub Desktop.
Enqueue custom print.css file for Paid Memberships Pro.
<?php
/**
* If anyone created a custom print.css file, add this code to a custom plugin to re-enqueue it in your theme or template directory.
*/
function my_enqueue_print_style() {
if ( file_exists( get_stylesheet_directory() . '/paid-memberships-pro/css/print.css' ) ) {
$print_css = get_stylesheet_directory_uri() . '/paid-memberships-pro/css/print.css';
} elseif ( file_exists( get_template_directory() . '/paid-memberships-pro/print.css' ) ) {
$print_css = get_template_directory_uri() . '/paid-memberships-pro/print.css';
} else {
return;
}
wp_enqueue_style( 'pmpro-print', $print_css, array(), '1.0', 'print' );
}
add_action( 'wp_enqueue_scripts', 'my_enqueue_print_style' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment