File: /home/dwauav0tm6jp/hosted/jeffreyjhart_com/wp-content/themes/skylab-old/page-gallery-no-margins.php
<?php
/**
* Template Name: Gallery with no margins
* Description: A Page Template that adds a gallery with no margins to pages
*
* @package WordPress
* @subpackage Skylab
* @since Skylab 1.0
*/
get_header(); ?>
<div id="main" class="clearfix">
<div id="primary">
<div id="content" role="main">
<header class="entry-header">
<h1 class="entry-title"><?php echo the_title();?></h1>
</header><!-- .entry-header -->
<?php if ( post_password_required() ) : ?>
<div class="password-protected">
<?php the_content(); ?>
</div>
<?php else : ?>
<?php if ( !empty( $post->post_content ) ) : ?>
<div class="page-content">
<?php while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; // end of the loop. ?>
</div>
<?php endif; ?>
<?php
global $post;
if ( metadata_exists( 'post', $post->ID, '_page_image_gallery' ) ) {
$page_image_gallery = get_post_meta( $post->ID, '_page_image_gallery', true );
} else {
// Backwards compat
$attachment_ids = array_filter( array_diff( get_posts( 'post_parent=' . $post->ID . '&numberposts=-1&post_type=attachment&orderby=menu_order&order=ASC&post_mime_type=image&fields=ids' ), array( get_post_thumbnail_id() ) ) );
$page_image_gallery = implode( ',', $attachment_ids );
}
$attachments = array_filter( explode( ',', $page_image_gallery ) );
$thumbs = array();
if ( $attachments ) { ?>
<div id="block-gallery-no-margins" class="<?php echo $photos_size_class; ?> clearfix">
<ul class="photos-gallery clearfix" id="gallery-<?php the_ID(); ?>">
<?php foreach ( $attachments as $attachment_id ) { ?>
<?php
$gallery_image_src = wp_get_attachment_image_src( $attachment_id, 'full' );
$zoom = $gallery_image_src[0];
$class = "media-image";
$gallery_image_title = esc_attr( get_the_title( $attachment_id ) );
?>
<li class="gallery-item <?php echo $class; ?>" data-attachment_id="<?php echo $attachment_id; ?>">
<a href="<?php echo $zoom; ?>" rel="external">
<?php $gallery_image_thumb = wp_get_attachment_image( $attachment_id, 'gallery-thumb-no-margins' ); ?>
<?php echo $gallery_image_thumb; ?>
<div class="entry-view-wrapper"></div>
</a>
</li>
<?php } ?>
</ul><!-- .photos-gallery -->
</div><!-- #block-gallery -->
<?php } else { ?>
<p class="no-found"><?php _e( 'No images found, please add some images.', 'mega' ); ?></p>
<?php } // end if ( $attachments ) ?>
<?php endif; // end if ( post_password_required() ?>
</div><!-- #content -->
</div><!-- #primary -->
<?php get_footer(); ?>