Skip to content

Instantly share code, notes, and snippets.

@Dinamiko
Created January 9, 2017 16:35
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/c92127daedaf017c1ed03b997d79bbc6 to your computer and use it in GitHub Desktop.
Save Dinamiko/c92127daedaf017c1ed03b997d79bbc6 to your computer and use it in GitHub Desktop.
<?php
/**
* dkpdfg-index.php
* This template is used to display the content in the PDF
*
* Do not edit this template directly,
* copy this template and paste in your theme (or child theme) inside a directory named dkpdfg
*/
?>
<html>
<head>
<link type="text/css" rel="stylesheet" href="<?php echo get_bloginfo( 'stylesheet_url' ); ?>" media="all" />
<style type="text/css">
body {
background:#FFF;
font-size:100%;
}
h1 {font-size:140%;}
h2 {font-size:120%;}
h3 {font-size:110%;}
h4 {font-size:100%;}
h5 {font-size:90%;}
h6 {font-size:80%;}
<?php if ( is_plugin_active( 'dk-pdf/dk-pdf.php' ) ) {
$css = get_option( 'dkpdf_pdf_custom_css', '' );
echo $css;
} ?>
</style>
</head>
<body>
<?php
$post_type_slug = 'doc';
$args = array(
'post_type' => $post_type_slug,
'post_status' => 'publish',
'posts_per_page' => -1
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post(); ?>
<h1><?php the_title();?></h1>
<?php 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