Skip to content

Instantly share code, notes, and snippets.

@Dinamiko
Created August 30, 2017 18:49
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Dinamiko/d0342e1332d497c69946a0e07aa26b4e 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%;
}
</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( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post(); ?>
<h1><?php the_title(); ?></h1>
<?php ws_job_location(); ?>
<?php
$expired_date = get_post_meta( $post->ID, '_job_expires', true );
$hide_expiration = get_post_meta( $post->ID, '_hide_expiration', true );
echo $expired_date.' - '.$hide_expiration;
?>
<?php }
}
wp_reset_postdata();
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment