Last active
January 23, 2016 22:43
-
-
Save Dinamiko/44f6816df9bd97c105bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<?php | |
global $post; | |
$pdf = get_query_var( 'pdf' ); | |
$post_type = get_post_type( $pdf ); | |
if( $pdf ) { | |
// get info | |
$title = get_the_title(); | |
if( has_post_thumbnail( $post->ID ) ) { | |
$thumbnail = get_the_post_thumbnail( $post->ID, 'medium' ); | |
} | |
$description = get_the_excerpt(); | |
$product = new WC_Product( $post->ID ); | |
$currency = get_woocommerce_currency_symbol(); | |
$regular_price = get_post_meta( $post->ID, '_regular_price'); | |
$sale_price = get_post_meta( $post->ID, '_sale_price'); | |
$link = get_the_permalink(); | |
// print info | |
echo esc_attr( $title ).'<br>'; | |
if( $thumbnail ) { echo $thumbnail; } | |
echo esc_html( $description ).'<br>'; | |
echo esc_attr( $regular_price[0] ). $currency .'<br>'; | |
if( $sale_price ) { | |
echo esc_attr( $sale_price[0] ). $currency .'<br>'; | |
} | |
echo esc_url( $link ).'<br>'; | |
} | |
?> | |
</body> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment