forked from nicolas-van/wordpress-simple-bootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage.php
More file actions
61 lines (48 loc) · 1.88 KB
/
Copy pathimage.php
File metadata and controls
61 lines (48 loc) · 1.88 KB
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
<?php
/**
* The WordPress template hierarchy first checks for any
* MIME-types and then looks for the attachment.php file.
*
* @link codex.wordpress.org/Template_Hierarchy#Attachment_display
*/
?>
<?php get_template_part( 'content', 'standard-top' ); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class("section"); ?> role="article">
<header>
<div class="article-header">
<h1 itemprop="headline">
<a href="<?php echo get_permalink($post->post_parent); ?>" rev="attachment"><?php echo esc_html(get_the_title($post->post_parent)); ?></a> » <?php the_title(); ?>
</h1>
</div>
</header>
<section class="post_content" itemprop="articleBody">
<!-- To display current image in the photo gallery -->
<div class="attachment-img">
<a href="<?php echo wp_get_attachment_url($post->ID); ?>">
<?php
$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
if ($image) :
?>
<img src="<?php echo $image[0]; ?>" alt="" />
<?php endif; ?>
</a>
</div>
</section>
<footer>
<?php the_tags('<p class="tags">', ' ', '</p>'); ?>
</footer>
</article>
<nav class="section">
<ul class="pager pager-unspaced">
<li class="previous"><?php next_image_link( false, '<span class="glyphicon glyphicon-chevron-left"></span> ' . __( 'Previous Image', "default")); ?></li>
<li class="next"><?php previous_image_link( false, __( 'Next Image', "default") . ' <span class="glyphicon glyphicon-chevron-right"></span>'); ?></li>
</ul>
</nav>
<?php comments_template(); ?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'content', 'not-found' ); ?>
<?php endif; ?>
<?php get_template_part( 'content', 'standard-bottom' ); ?>