source: trunk/www.guidonia.net/wp/wp-content/themes/atahualpa/index.php@ 44

Last change on this file since 44 was 44, checked in by luciano, 14 years ago
File size: 11.4 KB
Line 
1<?php
2global $options;
3foreach ($options as $value) {
4 if (get_option( $value['id'] ) === FALSE) {
5 $$value['id'] = $value['std'];
6 } else {
7 $$value['id'] = get_option( $value['id'] );
8 }
9}
10if ( is_page() ) { global $wp_query; $current_page_id = $wp_query->get_queried_object_id(); }
11?>
12<?php get_header(); ?>
13<?php // If there are any posts:
14if (have_posts()) : $postcount == 0; ?>
15<?php if( is_archive() AND function_exists('page2cat_output')) { page2cat_output($cat); } // This is for the plugin Page2Cat http://wordpress.org/extend/plugins/page2cat/ ?>
16
17 <?php
18 // Next/Previous PAGE Links (on multi post pages)
19 // in next_posts_link "next" means older posts
20 if ( !is_single() AND !is_page() AND strpos($bfa_ata_location_multi_next_prev,'Top')!==false AND show_posts_nav() ) {
21 if (function_exists('wp_pagenavi')) {
22 echo '<div class="wp-pagenavi-navigation">'; wp_pagenavi(); echo '</div>';
23 } else {
24 echo '<div class="navigation-top">
25 <div class="older' . $nav_home_add . '">';
26 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
27 next_posts_link(bfa_escape($bfa_ata_multi_next_prev_older)) :
28 previous_posts_link(bfa_escape($bfa_ata_multi_next_prev_newer));
29 echo ' &nbsp;</div>' . $nav_home_div . '<div class="newer' . $nav_home_add . '">&nbsp; ';
30 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
31 previous_posts_link(bfa_escape($bfa_ata_multi_next_prev_newer)) :
32 next_posts_link(bfa_escape($bfa_ata_multi_next_prev_older));
33 echo '</div>
34 <div class="clearboth"></div>
35 </div>';
36 }
37 }
38 ?>
39
40
41 <?php // Do this for all posts:
42 while (have_posts()) : the_post(); $postcount++; ?>
43
44 <?php
45 // Next/Previous POST Links (on single post pages)
46 // in next_post_link "next" means newer posts
47 if ( is_single() AND strpos($bfa_ata_location_single_next_prev,'Top')!==false ) {
48 echo '<div class="navigation-top">
49 <div class="older' . $nav_home_add_single . '">';
50 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ? previous_post_link(bfa_escape($bfa_ata_single_next_prev_older)) :
51 next_post_link(bfa_escape($bfa_ata_single_next_prev_newer));
52 echo ' &nbsp;</div>' . $nav_home_div_on_single . '<div class="newer' . $nav_home_add_single . '">&nbsp; ';
53 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ? next_post_link(bfa_escape($bfa_ata_single_next_prev_newer)) :
54 previous_post_link(bfa_escape($bfa_ata_single_next_prev_older));
55 echo '</div>
56 <div class="clearboth"></div>
57 </div>';
58 } ?>
59
60
61
62 <div class="post<?php
63 // new WP 2.7 "sticky" class only on real blog homepage
64 if (function_exists('is_sticky')) {
65 if ( is_home() AND !is_paged() AND is_sticky() ) {
66 echo " sticky";
67 }
68 }
69 ?>">
70
71
72 <?php // Post Kicker
73 if( (is_home() && $bfa_ata_post_kicker_home != "") OR
74 (is_page() && $bfa_ata_post_kicker_page != "") OR
75 (is_single() && $bfa_ata_post_kicker_single != "") OR
76 ( (is_archive() OR is_search() OR is_author() OR is_tag()) && $bfa_ata_post_kicker_multi != "") ) {
77 echo '<div class="post-kicker">';
78 if ( is_home() ) { echo postinfo("$bfa_ata_post_kicker_home"); }
79 elseif ( is_page() ) { echo postinfo("$bfa_ata_post_kicker_page"); }
80 elseif ( is_single() ) { echo postinfo("$bfa_ata_post_kicker_single"); }
81 else { echo postinfo("$bfa_ata_post_kicker_multi"); }
82 echo '</div>';
83 } ?>
84
85
86
87 <!-- Post Headline -->
88 <div class="post-headline">
89 <h2><?php
90 if( !is_single() AND !is_page() ) { ?>
91 <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php
92 if (function_exists('the_title_attribute')) {
93 the_title_attribute();
94 }
95 elseif (function_exists('the_title')) {
96 the_title();
97 } ?>"><?php
98 } the_title();
99 if( !is_single() AND !is_page() ) { ?>
100 </a><?php
101 } ?>
102 </h2>
103 </div>
104
105
106
107 <?php // Post Byline
108 if( (is_home() && $bfa_ata_post_byline_home != "") OR
109 (is_page() && $bfa_ata_post_byline_page != "") OR
110 (is_single() && $bfa_ata_post_byline_single != "") OR
111 ( (is_archive() OR is_search() OR is_author() OR is_tag()) && $bfa_ata_post_byline_multi != "") ) {
112 echo '<div class="post-byline">';
113 if ( is_home() ) { echo postinfo("$bfa_ata_post_byline_home"); }
114 elseif ( is_page() ) { echo postinfo("$bfa_ata_post_byline_page"); }
115 elseif ( is_single() ) { echo postinfo("$bfa_ata_post_byline_single"); }
116 else { echo postinfo("$bfa_ata_post_byline_multi"); }
117 echo '</div>';
118 } ?>
119
120
121
122 <!-- Post Body Copy -->
123 <div class="post-bodycopy clearfix">
124 <?php if ((is_home() && $bfa_ata_excerpts_home == "Full Posts") OR
125 (is_category() && $bfa_ata_excerpts_category == "Full Posts") OR
126 (is_date() && $bfa_ata_excerpts_archive == "Full Posts") OR
127 (is_tag() && $bfa_ata_excerpts_tag == "Full Posts") OR
128 (is_search() && $bfa_ata_excerpts_search == "Full Posts") OR
129 (is_author() && $bfa_ata_excerpts_author == "Full Posts") OR
130 is_single() OR
131 is_page() OR (is_home() AND !is_paged() AND $postcount <= $bfa_ata_full_posts_homepage) ) {
132 $bfa_ata_more_tag_final = str_replace("%post-title%", the_title('', '', false), $bfa_ata_more_tag);
133 the_content(bfa_escape($bfa_ata_more_tag_final));
134 } else {
135 the_excerpt();
136 } ?>
137 </div>
138
139
140
141 <?php // Post Pagination
142 if ((is_home() && $bfa_ata_excerpts_home == "Full Posts") OR
143 (is_category() && $bfa_ata_excerpts_category == "Full Posts") OR
144 (is_date() && $bfa_ata_excerpts_archive == "Full Posts") OR
145 (is_tag() && $bfa_ata_excerpts_tag == "Full Posts") OR
146 (is_search() && $bfa_ata_excerpts_search == "Full Posts") OR
147 (is_author() && $bfa_ata_excerpts_author == "Full Posts") OR
148 is_single() OR
149 is_page() ) {
150 wp_link_pages('before=<p class="post-pagination"><strong>' . __('Pages:','atahualpa') . '</strong> &after=</p>&next_or_number=number');
151 } ?>
152
153
154
155 <?php // Show Archives page if configured
156 if ( is_page() AND $current_page_id == $bfa_ata_archives_page_id ) { ?>
157 <div class="archives-page">
158
159 <?php if ( $bfa_ata_archives_date_show == "Yes" ) { ?>
160 <h3><?php echo $bfa_ata_archives_date_title; ?></h3>
161 <ul>
162 <?php wp_get_archives('type=' . $bfa_ata_archives_date_type . '&show_post_count=' . ($bfa_ata_archives_date_count == "Yes" ? '1' : '0')); ?>
163 </ul>
164 <?php }
165
166 if ( $bfa_ata_archives_category_show == "Yes" ) { ?>
167 <h3><?php echo $bfa_ata_archives_category_title; ?></h3>
168 <ul>
169 <?php wp_list_categories('title_li=&orderby=' . $bfa_ata_archives_category_orderby .
170 '&order=' . $bfa_ata_archives_category_order .
171 '&show_count=' . ($bfa_ata_archives_category_count == "Yes" ? '1' : '0') .
172 '&depth=' . $bfa_ata_archives_category_depth .
173 ($bfa_ata_archives_category_feed == "Yes" ? '&feed_image=' . get_bloginfo('template_directory') . '/images/icons/feed.gif' : '')); ?>
174 </ul>
175 <?php } ?>
176
177 </div>
178 <?php } ?>
179
180
181
182 <?php // Post Footer
183 if( (is_home() && $bfa_ata_post_footer_home != "") OR
184 (is_page() && $bfa_ata_post_footer_page != "") OR
185 (is_single() && $bfa_ata_post_footer_single != "") OR
186 ( (is_archive() OR is_search() OR is_author() OR is_tag()) && $bfa_ata_post_footer_multi != "") ) {
187 echo '<div class="post-footer">';
188 if ( is_home() ) { echo postinfo("$bfa_ata_post_footer_home"); }
189 elseif ( is_page() ) { echo postinfo("$bfa_ata_post_footer_page"); }
190 elseif ( is_single() ) { echo postinfo("$bfa_ata_post_footer_single"); }
191 else { echo postinfo("$bfa_ata_post_footer_multi"); }
192 echo '</div>';
193 } ?>
194
195
196
197 </div><!-- / Post -->
198
199
200
201 <?php // Next/Previous POST Links (on single post pages)
202 if ( is_single() AND strpos($bfa_ata_location_single_next_prev,'Middle')!==false ) {
203 echo '<div class="navigation-middle">
204 <div class="older' . ($bfa_ata_home_single_next_prev != '' ? '-home' : '') . '">';
205 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ? previous_post_link(bfa_escape($bfa_ata_single_next_prev_older)) :
206 next_post_link(bfa_escape($bfa_ata_single_next_prev_newer));
207 echo ' &nbsp;</div>' . ($bfa_ata_home_single_next_prev!= '' ? '<div class="home"><a href="' . get_option('home') . '/">' .
208 $bfa_ata_home_single_next_prev . '</a></div>' : '') . '<div class="newer' . ($bfa_ata_home_single_next_prev != '' ? '-home' : '') . '">&nbsp; ';
209 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ? next_post_link(bfa_escape($bfa_ata_single_next_prev_newer)) :
210 previous_post_link(bfa_escape($bfa_ata_single_next_prev_older));
211 echo '</div>
212 <div class="clearboth"></div>
213 </div>';
214 } ?>
215
216
217
218 <?php // Load Comments template (on single post pages, and "Page" pages, if set on options page)
219 if ( is_single() OR ( is_page() && $bfa_ata_comments_on_pages == "Yes") ) {
220 if (function_exists('paged_comments')) {
221 paged_comments_template(); // If plugin "Paged Comments" is activated, for WP 2.6 and older
222 } else {
223 comments_template(); // This will load either legacy comments template (for WP 2.6 and older) or the new standard comments template (for WP 2.7 and newer)
224 }
225 } ?>
226
227
228
229 <?php // Next/Previous POST Links (on single post pages)
230 // in next_post_link "next" means newer
231 if ( is_single() AND strpos($bfa_ata_location_single_next_prev,'Bottom')!==false ) {
232 echo '<div class="navigation-bottom">
233 <div class="older' . ($bfa_ata_home_single_next_prev != '' ? '-home' : '') . '">';
234 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
235 previous_post_link(bfa_escape($bfa_ata_single_next_prev_older)) :
236 next_post_link(bfa_escape($bfa_ata_single_next_prev_newer));
237 echo ' &nbsp;</div>' . ($bfa_ata_home_single_next_prev!= '' ? '<div class="home"><a href="' . get_option('home') . '/">' .
238 $bfa_ata_home_single_next_prev . '</a></div>' : '') . '<div class="newer' . ($bfa_ata_home_single_next_prev != '' ? '-home' : '') . '">&nbsp; ';
239 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
240 next_post_link(bfa_escape($bfa_ata_single_next_prev_newer)) :
241 previous_post_link(bfa_escape($bfa_ata_single_next_prev_older));
242 echo '</div>
243 <div class="clearboth"></div>
244 </div>';
245 } ?>
246
247
248
249 <?php // END of: Do this for all posts
250 endwhile; ?>
251
252
253 <?php
254 // Next/Previous PAGE Links (on multi post pages)
255 // in next_posts_link "next" means older
256 if ( !is_single() AND !is_page() AND strpos($bfa_ata_location_multi_next_prev,'Bottom')!==false AND show_posts_nav() ) {
257 if (function_exists('wp_pagenavi')) {
258 echo '<div class="wp-pagenavi-navigation">'; wp_pagenavi(); echo '</div>';
259 } else {
260 echo '<div class="navigation-bottom">
261 <div class="older' . $nav_home_add . '">';
262 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
263 next_posts_link(bfa_escape($bfa_ata_multi_next_prev_older)) :
264 previous_posts_link(bfa_escape($bfa_ata_multi_next_prev_newer));
265 echo ' &nbsp;</div>' . $nav_home_div . '<div class="newer' . $nav_home_add . '">&nbsp; ';
266 $bfa_ata_next_prev_orientation == 'Older Left, Newer Right' ?
267 previous_posts_link(bfa_escape($bfa_ata_multi_next_prev_newer)) :
268 next_posts_link(bfa_escape($bfa_ata_multi_next_prev_older));
269 echo '</div>
270 <div style="clear:both"></div>
271 </div>';
272 }
273 } ?>
274
275<?php
276// END of: If there are any posts
277// If there are no posts:
278else :
279?>
280
281
282 <h2><?php _e('Not Found','atahualpa'); ?></h2>
283 <p><?php _e("Sorry, but you are looking for something that isn't here.","atahualpa"); ?></p>
284
285
286<?php endif; ?>
287
288
289<?php get_footer(); ?>
Note: See TracBrowser for help on using the repository browser.