Skip to content

Instantly share code, notes, and snippets.

@jakzaizzat
Created May 27, 2019 08:36
Show Gist options
  • Save jakzaizzat/ef2d92b030e9a16de9c9fb2d9174a7f1 to your computer and use it in GitHub Desktop.
Save jakzaizzat/ef2d92b030e9a16de9c9fb2d9174a7f1 to your computer and use it in GitHub Desktop.
<?php
/**
* The template for displaying all single posts
*
* @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
*
* @package risetheme
*/
get_header();
?>
<?php while ( have_posts() ) : the_post(); ?>
<div class="flex flex-col md:flex-row">
<div id="primary" class="single-download-area w-full">
<main id="main" class="site-main flex flex-col justify-between h-full">
<article class="w-full px-2 mb-4" id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="breadcrumbs mb-4" typeof="BreadcrumbList" vocab="https://schema.org/">
<?php if(function_exists('bcn_display'))
{
bcn_display();
}?>
</div>
<h1 class="text-2xl font-semibold"><?= the_title(); ?></h1>
<?php risetheme_post_thumbnail(); ?>
<div class="entry-content">
<?php $categories = get_categories( array(
'orderby' => 'name',
'order' => 'ASC'
) );
?>
<div><?= the_content(); ?></div>
<!-- <a href="<?php the_field('single_url', 'option'); ?>">
<img src="<?php the_field('single_image', 'option'); ?>"/>
</a> -->
</div>
<footer class="entry-footer">
<?php risetheme_entry_footer(); ?>
</footer>
</article>
<a href="<?php the_field('single_url', 'option'); ?>">
<img src="<?php the_field('single_image', 'option'); ?>" class="mb-0"/>
</a>
</main>
</div>
<div id="sidebar-download">
<?php
$prices = edd_get_variable_prices( get_the_ID() );
if(count($prices) == 0) { ?>
<h3 class="mb-2 font-bold">FREE download</h3>
<?php
echo do_shortcode('[purchase_link id="' . get_the_ID() . '" text="Purchase" style="button" direct="true" class="btn-yellow w-full mb-0 block"]');
global $wp;
$current_url = home_url(add_query_arg(array($_GET), $wp->request));
echo do_shortcode('[edd_register redirect="'. $current_url .'"]');
} else { ?>
<h3 class="mb-2 font-bold">Buy Now</h3>
<div class="dropdown">
<?php
echo do_shortcode('[purchase_link id="' . get_the_ID() . '" ]');
?>
</div>
<?php } ?>
<ul class="list-reset border-b border-grey-light pb-8 mt-8">
<li class="flex items-center">
<img src="<?= get_template_directory_uri() ?>/images/tick.svg" class="h-3 w-3" alt="tick"/>
<span class="ml-2">Royalty <strong>free use</strong></span>
</li>
<li class="flex items-center">
<img src="<?= get_template_directory_uri() ?>/images/tick.svg" class="h-3 w-3" alt="tick"/>
<span class="ml-2"><strong>12 months</strong> priority support</span>
</li>
<li class="flex items-center">
<img src="<?= get_template_directory_uri() ?>/images/tick.svg" class="h-3 w-3" alt="tick"/>
<span class="ml-2">Use in client project</span>
</li>
</ul>
<p class="text-grey-dark text-sm mt-2 mb-2">View license details</p>
<a href="<?php the_field('demo'); ?>" target="_blank" class="btn-yellow-outline block w-full mb-8 download-link">Demo</a>
<div class="mb-8">
<h3 class="font-bold text-black mb-5">Detail</h3>
<div class="flex flex-wrap text-sm mb-2">
<div class="w-full md:w-1/2 text-gray-700">Last Update</div>
<div class="w-full md:w-1/2 text-black"><?php the_field('last_update'); ?></div>
</div>
<div class="flex flex-wrap text-sm mb-2">
<div class="w-full md:w-1/2 text-gray-700">Version</div>
<div class="w-full md:w-1/2 text-black"><?php the_field('version'); ?></div>
</div>
<div class="flex flex-wrap text-sm mb-2">
<div class="w-full md:w-1/2 text-gray-700">Compatible Browsers</div>
<div class="w-full md:w-1/2 text-black"><?php the_field('compatible'); ?></div>
</div>
<div class="flex flex-wrap text-sm mb-2">
<div class="w-full md:w-1/2 text-gray-700">Technology Used</div>
<div class="w-full md:w-1/2 text-black"><?php the_field('technology'); ?></div>
</div>
<div class="flex flex-wrap text-sm mb-2">
<div class="w-full md:w-1/2 text-grey">Categories</div>
<div class="w-full md:w-1/2">
<div>
<?php $terms = wp_get_post_terms( get_the_ID(), 'download_category');
foreach ($terms as $term) { ?>
<a href="/downloads/category/<?= $term->slug; ?>" class="download-link"><?= $term->name; ?></a>,
<?php } ?>
</div>
</div>
</div>
<div class="flex flex-wrap text-sm mb-2">
<div class="w-full md:w-1/2 text-grey">Tags</div>
<div class="w-full md:w-1/2">
<div>
<?php $terms = wp_get_post_terms( get_the_ID(), 'download_tag');
foreach ($terms as $term) { ?>
<a href="/downloads/tag/<?= $term->slug; ?>" class="download-link"><?= $term->name; ?></a>,
<?php } ?>
</div>
</div>
</div>
</div>
<h3 class="font-bold text-black mb-5">Author</h3>
<p class="text-sm"><?php the_field('author'); ?></p>
</div>
</div>
<?php endwhile; // End of the loop. ?>
<?php
//get_sidebar('download');
get_sidebar();
get_footer();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment