forked from chipbennett/oenology
/
post-entry.php
121 lines (120 loc) · 4.54 KB
/
post-entry.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
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
<?php
/**
* Template part file that contains the Post entry
*
* Contains Loop header, Loop content, and Loop footer.
*
* @uses oenology_hook_post_entry_after() Defined in /functions/hooks.php
* @uses oenology_hook_post_entry_before() Defined in /functions/hooks.php
*
* @link http://codex.wordpress.org/Function_Reference/dynamic_sidebar dynamic_sidebar()
* @link http://codex.wordpress.org/Function_Reference/get_template_part get_template_part()
* @link http://codex.wordpress.org/Function_Reference/is_archive is_archive()
* @link http://codex.wordpress.org/Function_Reference/is_search is_search()
* @link http://codex.wordpress.org/Function_Reference/the_content the_content()
* @link http://codex.wordpress.org/Function_Reference/the_excerpt the_excerpt()
* @link http://codex.wordpress.org/Function_Reference/wp_attachment_is_image wp_attachment_is_image()
* @link http://codex.wordpress.org/Function_Reference/wp_link_pages wp_link_pages()
*
* @package Oenology
* @copyright Copyright (c) 2010, Chip Bennett
* @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU General Public License, v2 (or newer)
*
* @since Oenology 1.0
*/
?>
<?php
// Fire the 'oenology_hook_post_entry_before' custom action hook
//
// @param null
// @return mixed any output hooked into 'oenology_hook_post_entry_before'
oenology_hook_post_entry_before();
?>
<!-- Post Entry Begin -->
<?php
// only display the full post content on
// the blog home page, single blog posts,
// and static Pages
if (
(
// WordPress conditional tag that returns true if
// the current page is an archive index page
is_archive()
// WordPress conditional tag that returns true if
// the current page is a search results page
|| is_search()
)
// WordPress conditional tag that returns true if
// the current page has an image mime-type attachment
&& ! wp_attachment_is_image()
// WordPress template tag that returns the post format
// type of the current post, as a string, or FALSE iff
// the current post does not have a post format assigned.
// Here, get_post_format() is used rather than
// has_post_format(), because has_post_format() requires
// a post format to be passed as a parameter, rendering
// it unsuitable for use to determine if the post has
// *any* post format assigned.
&& ! get_post_format()
) {
// Output the Post Excerpt
//
// Codex reference: {@link http://codex.wordpress.org/Function_Reference/the_excerpt}
the_excerpt();
}
// for image Attachment Pages, display custom template
else if (
// WordPress conditional tag that returns true if
// the current page has an image mime-type attachment
wp_attachment_is_image()
) {
// Include the specified Theme template part file
//
// Codex reference: {@link http://codex.wordpress.org/Function_Reference/get_template_part get_template_part}
//
// get_template_part( $slug ) will attempt to include $slug.php.
// The function will attempt to include files in the following
// order, until it finds one that exists: the Theme's $slug.php,
// the parent Theme's $slug.php
//
// get_template_part( $slug , $name ) will attempt to include
// $slug-$name.php. The function will attempt to include files
// in the following order, until it finds one that exists: the
// Theme's $slug-$name.php, the Theme's $slug.php, the parent
// Theme's $slug-$name.php, the parent Theme's $slug.php
//
// Child Themes can replace this template part file globally,
// via "post-entry-image.php"
get_template_part( 'post-entry-image' );
}
// for all other contexts, display full Post content
else {
// Output the Post Content
//
// Codex reference: {@link http://codex.wordpress.org/Function_Reference/the_content the_content}
//
// @param string $more_link_text text to use for the "More" link; default: '(more...)'
// @param bool $strip_teaser strip text prior to "More" link on Single Post view; default: true
the_content('Read the rest of this entry »');
// Output the post pagination links
// if current post is paginated
//
// Codex reference: {@link http://codex.wordpress.org/Function_Reference/wp_link_pages wp_link_pages}
wp_link_pages( array(
// Apply class="link-pages" to the default <p> tag
'before' => '<p class="link-pages">Page: '
) );
}
?>
<!-- Post Entry End -->
<?php
// Widgetized sidebar 'post-content-below'
dynamic_sidebar( 'post-entry-below' );
?>
<?php
// Fire the 'oenology_hook_post_entry_after' custom action hook
//
// @param null
// @return mixed any output hooked into 'oenology_hook_post_entry_after'
oenology_hook_post_entry_after();
?>