public
Last active

  • Download Gist
template-page-comments.php
PHP
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91
<?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(); ?>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.