-
Notifications
You must be signed in to change notification settings - Fork 16
/
page-feature.php
133 lines (79 loc) · 2.82 KB
/
page-feature.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
122
123
124
125
126
127
128
129
130
131
132
133
<?php
/**
* Description of Template goes here
*
Template Name: Featured Story
*/
?>
<?php get_header(); ?>
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
<?php
$children = get_pages('child_of='.$post->ID);
$parenttitle = get_the_title($post->post_parent);
$parenturl = get_permalink($post->post_parent); // the second parameter is whether to use the title as the permalink text
?>
<h2 class="sp-header">
<?php // if ($children) { echo 'Feature'; } else { echo '<a href="'. $parenturl . '">' . $parenttitle . '</a>'; } ?>
Feature
</h2>
<?php if(has_term($term_optional,'feature') & !$children) { ?>
<dl class="short-breadcrumb mini-nav">
<dt><?php echo '<a href="'. $parenturl . '">' . $parenttitle . '</a>'; ?></dt>
</dl>
<?php
$next = next_page_not_post($empty, $empty, 'sort_column=menu_order&sort_order=asc');
if (!empty($next)) : ?>
<dl class="next-page mini-nav">
<dt>Next Page:</dt>
<dd><?php echo next_page_not_post(); ?></dd>
</dl>
<?php endif ?>
<?php } ?>
<div id="intro">
<h1><?php the_title(); ?></h1>
<?php
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
if ($children) { ?>
<div class="feature-nav moved-feature-nav">
<h3><?php the_title(); ?></h3>
<ol><?php echo $children; ?></ol>
</div>
<?php } ?>
<?php the_content(); ?>
<?php if(has_term($term_optional,'feature') && !$children) { ?>
<div class="pagination clearfix">
<?php
$nextPage = next_page_not_post('Next page', '', 'sort_column=post_date&sort_order=desc');
$prevPage = previous_page_not_post('Previous page', '', 'sort_column=post_date&sort_order=desc');
if (!empty($nextPage) || !empty($prevPage)) {
// if (!empty($prevPage)) echo '<div class="next">Previous page: ' . $prevPage . '</div>';
// if (!empty($nextPage)) echo '<div class="next">Next page: ' . $nextPage . '</div>';
// if (!empty($prevPage)) echo '← ' . $prevPage;
// if (!empty($nextPage)) echo $nextPage . ' → ';
//echo '<hr>';
//if (!empty($prevPage)) echo '← ' . previous_page_not_post('Previous page');
//if (!empty($nextPage)) echo next_page_not_post('Next page') . ' →';
if (!empty($prevPage)) echo previous_page_not_post('← Previous page');
if (!empty($nextPage)) echo next_page_not_post('Next page →');
}
?>
</div>
<?php } ?>
<div class="utilities">
<div class="print-feature"></div>
</div>
<?php if (!$children) { ?>
<?php
$children = wp_list_pages('title_li=&child_of='.$post->post_parent.'&echo=0');
if ($children) { ?>
<div class="feature-nav">
<h3><?php if ($children) { echo get_the_title($post->post_parent); } else {} ?></h3>
<ol><?php echo $children; ?></ol>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
<?php endwhile; endif; ?>
<?php get_sidebar() ?>
<?php get_footer(); ?>