Skip to content

Instantly share code, notes, and snippets.

@purethemes
Last active December 19, 2015 09:39
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 purethemes/5934115 to your computer and use it in GitHub Desktop.
Save purethemes/5934115 to your computer and use it in GitHub Desktop.
<?php
/**
* Template Name: Page with comments
*
* The "Template Name:" bit above allows this to be selectable
* from a dropdown menu on the edit page screen.
*
* @package WordPress
* @subpackage purepress
* @since purepress 1.0
*/
$headertype = ot_get_option('pp_headertype');
if($headertype == 'full') { get_header('full'); } else { get_header(); }
?>
<!-- 960 Container -->
<div class="container floated">
<div class="sixteen floated page-title">
<h1><?php the_title(); ?> <?php $subtitle = get_post_meta($post->ID, 'pp_subtitle', true); if($subtitle) echo "<span>".$subtitle."</span>";?>
<?php edit_post_link( __( 'Edit', 'purepress' ), '<span class="edit-link">', '</span>' ); ?></h1>
<?php if(ot_get_option('pp_breadcrumbs') != 'no') echo dimox_breadcrumbs(); ?>
</div>
</div>
<!-- 960 Container / End -->
<!-- Page Content -->
<div id="post-<?php the_ID(); ?>" <?php post_class('page-content'); ?>>
<!-- 960 Container -->
<!-- Gallery Container -->
<?php $ids = get_post_meta($post->ID, 'pp_gallery_slider', TRUE);
if($ids) { ?>
<div class="container">
<div class="sixteen columns">
<?php
$args = array(
'post_type' => 'attachment',
'post_status' => 'inherit',
'post_mime_type' => 'image',
'post__in' => explode( ",", $ids),
'posts_per_page' => '-1',
'orderby' => 'post__in'
);
$images_array = get_posts( $args );
if ( $images_array ) {
$captions = ot_get_option('pp_portfolio_caption');
?>
<section class="flexslider">
<ul class="slides">
<?php foreach( $images_array as $images ) : setup_postdata($images); ?>
<!-- 960 Container -->
<?php
$attachment = wp_get_attachment_image_src($images->ID, 'full');
$thumb = wp_get_attachment_image_src($images->ID, 'portfolio-main');
?>
<li>
<a href="<?php echo $attachment[0] ?>" rel="fancybox-gallery" title="<?php echo $images->post_title; ?>" >
<img src="<?php echo $thumb[0] ?>" alt="<?php echo $images->post_title; ?>" />
<?php if($captions == 'yes') { ?><div class="slide-caption"><h3><?php echo $images->post_title; ?></h3></div><?php } ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</section>
<!-- End 960 Container -->
<?php
} //eof if type
wp_reset_query(); ?>
</div>
</div><!-- Gallery Container / End -->
<?php } ?>
<div class="container">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'purepress' ), 'after' => '</div>' ) ); ?>
<div class="line"></div>
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() )
comments_template( '', true );
?>
</div>
</div>
<!-- Page Content / End -->
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment