Skip to content

Instantly share code, notes, and snippets.

@Dinamiko
Created December 5, 2016 09:49
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 Dinamiko/8bf97a3962f140ef34752477116ae4f4 to your computer and use it in GitHub Desktop.
Save Dinamiko/8bf97a3962f140ef34752477116ae4f4 to your computer and use it in GitHub Desktop.
<html>
<head>
<link type="text/css" rel="stylesheet" href="<?php echo get_bloginfo( 'stylesheet_url' ); ?>" media="all" />
<?php
$wp_head = get_option( 'dkpdf_print_wp_head', '' );
if( $wp_head == 'on' ) {
wp_head();
}
?>
<style type="text/css">
body {
background:#FFF;
font-size: 100%;
}
<?php
$css = get_option( 'dkpdf_pdf_custom_css', '' );
echo $css;
?>
</style>
</head>
<body>
<?php
global $post;
$pdf = get_query_var( 'pdf' );
$post_type = get_post_type( $pdf );
$args = array(
'p' => $pdf,
'post_type' => $post_type,
'post_status' => 'publish'
);
$the_query = new WP_Query( apply_filters( 'dkpdf_query_args', $args ) );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
global $post; ?>
<?php
// add your stuff here
the_content();
?>
<?php }
}
wp_reset_postdata();
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment