/
attachment-image.php
54 lines (36 loc) · 1.8 KB
/
attachment-image.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
<?php get_header(); // Loads the header.php template. ?>
<div id="content" class="hfeed" role="main">
<?php if ( have_posts() ) : ?>
<?php while ( have_posts() ) : ?>
<?php the_post(); // Loads the post data. ?>
<article id="post-<?php the_ID(); ?>" class="<?php hybrid_entry_class(); ?>">
<div class="entry-media">
<?php if ( has_excerpt() ) {
$src = wp_get_attachment_image_src( get_the_ID(), 'full' );
echo do_shortcode( sprintf( '[caption align="aligncenter" width="%1$s"]%3$s %2$s[/caption]', esc_attr( $src[1] ), get_the_excerpt(), wp_get_attachment_image( get_the_ID(), 'full', false ) ) );
} else {
echo wp_get_attachment_image( get_the_ID(), 'full', false, array( 'class' => 'aligncenter' ) );
} ?>
</div><!-- .entry-media -->
<header class="entry-header">
<h1 class="entry-title"><?php single_post_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php wp_link_pages( array( 'before' => '<p class="page-links">' . __( 'Pages:', 'eino' ), 'after' => '</p>' ) ); ?>
</div><!-- .entry-content -->
</article><!-- .hentry -->
<div class="attachment-meta">
<?php $gallery = gallery_shortcode( array( 'columns' => 6, 'numberposts' => -1, 'id' => $post->post_parent, 'exclude' => get_the_ID() ) ); ?>
<?php if ( !empty( $gallery ) ) { ?>
<div class="image-gallery">
<h3><?php _e( 'Gallery', 'eino' ); ?></h3>
<?php echo $gallery; ?>
</div>
<?php } ?>
</div><!-- .attachment-meta -->
<?php comments_template(); // Loads the comments.php template. ?>
<?php endwhile; // End while loop. ?>
<?php endif; // End if check. ?>
</div><!-- #content -->
<?php get_footer(); // Loads the footer.php template. ?>