festival_lgbt /wp-content/themes/ifeature/image.php

Language PHP Lines 170
MD5 Hash c2e650c7da9df065b9fa716ecefb73d1
Repository https://github.com/Bochet/festival_lgbt.git View Raw File
  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
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<?php
/**
 * Image Template
 *
 * Please do not edit this file. This file is part of the CyberChimps Framework and all modifications
 * should be made in a child theme.
 *
 * @category CyberChimps Framework
 * @package  Framework
 * @since    1.0
 * @author   CyberChimps
 * @license  http://www.opensource.org/licenses/gpl-license.php GPL v2.0 (or later)
 * @link     http://www.cyberchimps.com/
 */
 
get_header(); ?>

<?php do_action( 'cyberchimps_before_container'); ?>

<div id="container" <?php cyberchimps_filter_container_class(); ?>>
	
	<?php do_action( 'cyberchimps_before_content_container'); ?>
	
	<div id="content" <?php cyberchimps_filter_content_class(); ?>>
		
		<?php do_action( 'cyberchimps_before_content'); ?>
		
		<?php while ( have_posts() ) : the_post(); ?>

			<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
				<header class="entry-header">
					<h2 class="entry-title"><?php the_title(); ?></h2>

					<div class="entry-meta">
						<?php
							$metadata = wp_get_attachment_metadata();
							printf( '%8$s <span class="entry-date"><time class="entry-date" datetime="%1$s">%2$s</time></span> - %9$s: <a href="%3$s" title="Link to full-size image">%4$s &times; %5$s</a> in <a href="%6$s" title="Return to %7$s" rel="gallery">%7$s</a>',
								esc_attr( get_the_date( 'c' ) ),
								esc_html( get_the_date() ),
								wp_get_attachment_url(),
								$metadata['width'],
								$metadata['height'],
								get_permalink( $post->post_parent ),
								get_the_title( $post->post_parent ),
								__( 'Published', 'cyberchimps' ),
								__( 'size', 'cyberchimps' )
							);
						?>
						<?php edit_post_link( __( 'Edit', 'cyberchimps' ), '<span class="sep"> | </span> <span class="edit-link">', '</span>' ); ?>
					</div><!-- .entry-meta -->

					<nav id="image-navigation">
						<span class="previous-image"><?php previous_image_link( false, '&larr; ' . __( 'Previous', 'cyberchimps' ) ); ?></span>
						<span class="next-image"><?php next_image_link( false, __( 'Next', 'cyberchimps' ) . ' &rarr;' ); ?></span>
					</nav><!-- #image-navigation -->
				</header><!-- .entry-header -->

				<div class="entry-content">

					<div class="entry-attachment">
						<div class="attachment">

							<a href="<?php wp_get_attachment_link( $post->ID, 'fullsize' ); ?>" title="<?php echo esc_attr( get_the_title() ); ?>" rel="attachment"><?php
								$attachment_size = apply_filters( 'cyberchimps_attachment_size', array( 1200, 1200 ) ); // Filterable image size.
								echo wp_get_attachment_image( $post->ID, $attachment_size );
							?></a>
						</div><!-- .attachment -->

						<?php if ( ! empty( $post->post_excerpt ) ) : ?>
						<div class="entry-caption">
							<?php the_excerpt(); ?>
						</div>
						<?php endif; ?>
					</div><!-- .entry-attachment -->

					<?php the_content(); ?>
					<?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'cyberchimps' ), 'after' => '</div>' ) ); ?>

				</div><!-- .entry-content -->
				
				<?php
				// HS Thumbnail next and previous image
				$attachments = array_values( 
					get_children(
						array(
							'post_parent' => $post->post_parent,
							'post_status' => 'inherit',
							'post_type' => 'attachment',
							'post_mime_type' => 'image',
							'order' => 'ASC',
							'orderby' => 'menu_order ID'
						) 
					)
				);
				
				foreach ( $attachments as $k => $attachment ) :
					if ( $attachment->ID == $post->ID )
						break;

					$previous_image = isset( $attachments[$k-1] ) ? $attachments[$k-1]->ID : false;
					$next_image =  isset( $attachments[$k+1] ) ? $attachments[$k+1]->ID : false;
					
					$first_image = isset( $attachments[0] ) ? $attachments[0]->ID : false;
					$last_image = isset( $attachments[$k+1] ) ? end( $attachments )->ID : false;
					
					$previous_url = isset( $attachments[$k-1] ) ? get_permalink( $attachments[$k-1]->ID ) : get_permalink($attachments[0]->ID);
					$next_url =  isset( $attachments[$k+1] ) ? get_permalink( $attachments[$k+1]->ID ) : get_permalink($attachments[0]->ID);
					
					$first_url = isset( $attachments[0] ) ? get_permalink( $attachments[0]) : false;
					$last_url = isset( $attachments[$k+1] ) ? get_permalink(end($attachments)->ID) : get_permalink($attachments[0]->ID);
				?>
					<div class="row-fluid gallery-pagination">
						<div class="span6 previous-image">
							<?php if( $previous_image == false && count( $attachments ) > 1 ): ?>
								<a href="<?php echo $last_url; ?>"><?php echo wp_get_attachment_image( $last_image, 'thumbnail' ); ?></a>
							<?php elseif( $previous_image != $post->ID ): ?>
								<a href="<?php echo $previous_url; ?>"><?php echo wp_get_attachment_image( $previous_image, 'thumbnail' ); ?></a>
							<?php endif; ?>
						</div><!-- span6 -->
						
						<div class="span6 next-image">
							<?php if( $next_image == false && count( $attachments > 1 ) ): ?>
								<a href="<?php echo $first_url; ?>"><?php echo wp_get_attachment_image( $first_image, 'thumbnail' ); ?></a>
							<?php elseif( $next_image != $post->ID ): ?>
								<a href="<?php echo $next_url; ?>"><?php echo wp_get_attachment_image( $next_image, 'thumbnail' ); ?></a>
							<?php endif; ?>
						</div><!-- span6 -->
					</div><!-- row fluid -->
				<?php endforeach; ?>
				<?php // HS END Thumbnail next and previous image ?>
          
          
				<footer class="entry-meta">
					<?php if ( comments_open() && pings_open() ) : // Comments and trackbacks open ?>
						<?php printf( '<a class="comment-link" href="#respond" title="Post a comment">%1$s</a> %2$s: <a class="trackback-link" href="%3$s" title="Trackback URL for your post" rel="trackback">%4$s</a>.',
														__( 'Post a comment', 'cyberchimps' ),
														__( 'or leave a trackback', 'cyberchimps' ),
														get_trackback_url(),
														__( 'Trackback URL', 'cyberchimps' ) ); ?>
					<?php elseif ( ! comments_open() && pings_open() ) : // Only trackbacks open ?>
						<?php printf( '%1$s: <a class="trackback-link" href="%2$s" title="%3$s" rel="trackback">%3$s</a>.',
													__( 'Comments are closed, but you can leave a trackback', 'cyberchimps' ), 
													get_trackback_url(),
													__( 'Trackback URL', 'cyberchimps' ) ); ?>
					<?php elseif ( comments_open() && ! pings_open() ) : // Only comments open ?>
						<?php printf( '%1$s <a class="comment-link" href="#respond" title="Post a comment">%2$s</a>.',
													__( 'Trackbacks are closed, but you can', 'cyberchimps' ),
													__( 'post a comment', 'cyberchimps' ) ); ?>
					<?php elseif ( ! comments_open() && ! pings_open() ) : // Comments and trackbacks closed ?>
						<?php _e( 'Both comments and trackbacks are currently closed.', 'cyberchimps' ); ?>
					<?php endif; ?>
					<?php edit_post_link( __( 'Edit', 'cyberchimps' ), ' <span class="edit-link">', '</span>' ); ?>
				</footer><!-- .entry-meta -->
			</article><!-- #post-<?php the_ID(); ?> -->

			<?php comments_template(); ?>

		<?php endwhile; // end of the loop. ?>
		
	<?php do_action( 'cyberchimps_after_content'); ?>
		
	</div><!-- #content -->
	
	<?php do_action( 'cyberchimps_after_content_container'); ?>
		
</div><!-- #container .row-fluid-->

<?php do_action( 'cyberchimps_after_container'); ?>

<?php get_footer(); ?>
Back to Top