/content-gallery.php
PHP | 68 lines | 51 code | 13 blank | 4 comment | 8 complexity | 29feb4d32c6349719014184c1e6fcb99 MD5 | raw file
Possible License(s): AGPL-1.0
- <?php
- /**
- * @package WordPress
- * @subpackage Yoko
- */
- ?>
-
- <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
-
- <div class="entry-post-format">
- <header class="entry-header">
- <h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'yoko' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
- <p><?php echo get_the_date(); ?> <?php _e( 'by', 'yoko' ); ?> <?php the_author() ?>
- <?php if ( comments_open() ) : ?> | <?php comments_popup_link( __( '0 comments', 'yoko' ), __( '1 Comment', 'yoko' ), __( '% Comments', 'yoko' ) ); ?><?php endif; ?></p>
- </header><!-- end entry-header -->
-
- <?php if ( is_search() ) : // Only display Excerpts for search pages ?>
- <div class="entry-summary">
- <?php the_excerpt( __( 'View the pictures →', 'yoko' ) ); ?>
- </div><!-- end entry-summary -->
- <?php else : ?>
-
- <?php if ( post_password_required() ) : ?>
- <?php the_content( __( 'View the pictures →', 'yoko' ) ); ?>
-
- <?php else : ?>
- <?php
- $images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
- if ( $images ) :
- $total_images = count( $images );
- $image = array_shift( $images );
- $image_img_tag = wp_get_attachment_image( $image->ID, 'medium' );
- ?>
-
- <figure class="gallery-thumb">
- <a href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>
- </figure><!-- end gallery-thumb -->
-
- <?php endif; ?>
-
- <div class="entry-post-format">
- <?php the_content( __( 'View the pictures →', 'yoko' ) ); ?>
- <?php endif; ?>
-
- <p class="pics-count"><?php printf( _n( 'This gallery contains <a %1$s>%2$s photo</a>.', 'This gallery contains <a %1$s>%2$s photos</a>', $total_images, 'yoko' ),
- 'href="' . get_permalink() . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'yoko' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark"',
- number_format_i18n( $total_images )
- ); ?></p>
-
- </div><!-- end entry-content-gallery -->
- <?php endif; ?>
-
- <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'yoko' ), 'after' => '</div>' ) ); ?>
-
- <footer class="entry-meta">
- <p><?php if ( count( get_the_category() ) ) : ?>
- <?php printf( __( 'Categories: %2$s', 'yoko' ), 'entry-utility-prep entry-utility-prep-cat-links', get_the_category_list( ', ' ) ); ?> |
- <?php endif; ?>
- <?php $tags_list = get_the_tag_list( '', ', ' );
- if ( $tags_list ): ?>
- <?php printf( __( 'Tags: %2$s', 'yoko' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list ); ?> |
- <?php endif; ?>
- <a href="<?php echo get_permalink(); ?>"><?php _e( 'Permalink ', 'yoko' ); ?></a>
- <?php edit_post_link( __( 'Edit →', 'yoko' ), '| <span class="edit-link">', '</span>' ); ?></p>
- </footer><!-- end entry-meta-->
- </div><!-- end entry-gallery -->
-
- </article><!-- end post-<?php the_ID(); ?> -->