HEX
Server: Apache
System: Linux p3plzcpnl489499.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: dwauav0tm6jp (6177017)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/dwauav0tm6jp/hosted/jeffreyjhart_com/wp-content/themes/skylab/page-gallery.php
<?php
/**
 * Template Name: Gallery
 * Description: A Page Template that adds a gallery 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 				  
					$showtitle = get_post_meta( $post->ID, 'mega_photos_title', true );
					$photos_size = get_post_meta( $post->ID, 'mega_photos_size', true );
					
					if ( $showtitle == __( 'yes', 'mega' ) )
						$showtitle = 'true';
					else $showtitle = 'false';
					
					if ( $photos_size == __( 'width', 'mega' ) )
						$photos_size_class = 'fixed-width';
					else $photos_size_class = 'fixed-height';
					?>
						
					<?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" 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 if ( $showtitle == 'true' ) echo 'title="'. $gallery_image_title .'"'; ?>>
											<?php
											if ( $photos_size == __( 'width', 'mega' ) ) {
												$gallery_image_thumb = wp_get_attachment_image( $attachment_id, 'gallery-thumb-fixed-width' );
											} else {
												$gallery_image_thumb = wp_get_attachment_image( $attachment_id, 'gallery-thumb' );
											}
											?>
											
											<?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(); ?>