Uh oh!
There was an error while loading. Please reload this page.
This repository was archived by the owner on Mar 24, 2020. It is now read-only.
- Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathloop-single.php
More file actions
Latest commit
executable file
·81 lines (63 loc) · 2.96 KB
/
Copy pathloop-single.php
File metadata and controls
executable file
·81 lines (63 loc) · 2.96 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?phpif ( have_posts() ) while ( have_posts() ) : the_post(); ?>
<article <?phppost_class('article'); ?>>
<header>
<?php// 1) Link to the parent post, this is used for Pages, attachments, and custom post-types that are hierarchical ?>
<?phpif ( !empty( $post->post_parent ) ) : ?>
<span></span><a href="<?phpechoget_permalink( $post->post_parent ); ?>" title="<?phpesc_attr( printf( __( 'Return to %s', 'zero' ), get_the_title( $post->post_parent ) ) ); ?>" rel="gallery"><?php
printf( __( 'Go up to %s', 'zero' ), get_the_title( $post->post_parent ) );
?></a></span>
<?phpendif; ?>
<?php// 3) Display the publish date of the post ?>
<?php// 4) Display and link to the author ?>
<a href="<?phpechoget_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?phpthe_author(); ?></a>
<?php// 5) Display the categories for the post ?>
<?phpget_the_category_list( ', ' ); ?>
<?php// 6) Display the tags for the post ?>
<?phpthe_tags( ); ?>
<?php// 7) Display the terms from a custom taxonomy ?>
<?php// the_terms( $post->ID, 'TAXONOMY' );?>
<?php// 8) Link to full size attachment ?>
<?phpif(wp_attachment_is_image()) {
printf('<a href="%1$s">%2$s</a>', wp_get_attachment_url(), __('View full-size image', 'zero'));
} elseif(wp_get_attachment_url()) {
printf('<a href="%1$s">%2$s</a>', wp_get_attachment_url(), __('Download', 'zero'));
}?>
<?php// 9) Display attachment meta data ?>
<?phpif ( is_attachment() && $metadata = wp_get_attachment_metadata()) {
echo'<dl class="attachments">';
foreach($metadataas$key => $val) {
echo'<dt>'.$key.'</dt>';
echo'<dd>';
switch($key) {
case'image_meta':
echo'<dl>';
foreach($valas$imk => $imv) {
echo'<dt>'.$imk.'</dt>';
echo'<dd>'.$imv.'</dd>';
}
echo'</dl>';
break;
case'sizes':
echo'<ul>';
foreach($valas$size) {
$image_url = wp_get_attachment_image_src($post->ID, array($size['width'], $size['height']));
echo'<li><a href="'.$image_url[0].'">'.$size['width'].'x'.$size['height'].'</a></li>';
}
echo'</ul>';
break;
default:
echo$val;
}
echo'</dd>';
}
echo'</dl>';
} ?>
</header>
<div class="prose"><?phpthe_content(); ?></div>
<footer>
<?phpedit_post_link( __( 'Edit', 'zero' ), ' <span class="edit-link">', '</span>' ); ?>
<?phpwp_link_pages( array( 'before' => '<div class="pager">' . __( 'Pages:', 'zero' ), 'after' => '</div>' ) ); ?>
</footer>
<?phpcomments_template( '', true ); ?>
</article>
<?phpendwhile; // end of the loop. ?>