Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created January 27, 2020 21:10
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 dancameron/fe491f1669d342ba75effdb19582bd19 to your computer and use it in GitHub Desktop.
Save dancameron/fe491f1669d342ba75effdb19582bd19 to your computer and use it in GitHub Desktop.
Custom PDF CSS
<?php // don't include this line in your functions.php, since it already starts with it.
function _custom_si_pdf_service_scripts( $old_scripts_and_styles ) {
$scripts_and_styles = $old_scripts_and_styles; // remove this line if you don't want to remove the default styling and scripts
ob_start(); // place your custom styles and javascript below ?>
<style type="text/css">
body.si_default_theme header#header {
background-color: #87d57c;
}
body.si_default_theme .title, body.si_default_theme #intro .inner .column span, body.si_default_theme #notes .item .header h3 {
color: #fff
}
</style>
<?php
$scripts_and_styles .= ob_get_clean();
return $scripts_and_styles;
}
add_filter( 'si_pdf_service_scripts', '_custom_si_pdf_service_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment