Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 469 lines (362 sloc) 14.085 kB
03275de @splorp Added Starkers 2.8.5 theme files
splorp authored
1 <?php
2 /**
3 * @package WordPress
7b590ff @splorp Updated @subpackage tags, again
splorp authored
4 * @subpackage Tersus
03275de @splorp Added Starkers 2.8.5 theme files
splorp authored
5 */
6
3004525 @splorp THEME_NAME is now defined the same way as other constants
splorp authored
7 // Define Theme Constants
8
9 $theme_data = get_theme_data(TEMPLATEPATH.'/style.css');
10
11 define('THEME_URI', $theme_data['URI']);
12 define('THEME_NAME', $theme_data['Name']);
13 define('THEME_AUTHOR', $theme_data['Author']);
14 define('THEME_VERSION', trim($theme_data['Version']));
15 define('THEME_DESCRIPTION', trim($theme_data['Description']));
16
17
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
18 // Tersus Theme Options
19
2e1ee0e @cdharrison Fixed Issue 21.
authored
20 $themename = "Tersus";
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
21 $shortname = "tersus";
22 $options = array (
23 array( "name" => "Flavor",
f9d60e6 @splorp Tweaked theme options labels and descriptions
splorp authored
24 "desc" => "Select which theme style you’d like to use.",
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
25 "id" => $shortname."_style_sheet",
26 "type" => "select",
27 "options" => array( "Default", "Advanced", "Super Ginormous" ),
28 "std" => "default"),
cb39e40 @splorp New theme options for page and category lists
splorp authored
29 array( "name" => "Sidebar",
30 "desc" => "Show subpages in page list",
31 "id" => $shortname."_page_depth",
32 "type" => "checkbox",
33 "std" => "true"),
34 array( "name" => "",
35 "desc" => "Show the number of posts beside each category",
36 "id" => $shortname."_category_count",
37 "type" => "checkbox",
38 "std" => "true"),
31c80bd @splorp New theme option for archive lists
splorp authored
39 array( "name" => "",
40 "desc" => "Show the number of posts beside each archive",
41 "id" => $shortname."_archive_count",
42 "type" => "checkbox",
43 "std" => "true"),
dfcff5d @splorp Theme option page formatting and nomenclature
splorp authored
44 array( "name" => "Announcement",
f9d60e6 @splorp Tweaked theme options labels and descriptions
splorp authored
45 "desc" => "Display the following text on every page",
e061214 @splorp Added theme option to activate global announcement text
splorp authored
46 "id" => $shortname."_announcement_display",
47 "type" => "checkbox",
f9d60e6 @splorp Tweaked theme options labels and descriptions
splorp authored
48 "std" => ""),
49 array( "name" => "",
50 "desc" => "HTML may be used to format the announcement text.",
e061214 @splorp Added theme option to activate global announcement text
splorp authored
51 "id" => $shortname."_announcement",
e9d3dc3 @splorp Added rudimentary theme option for global admin notice
splorp authored
52 "type" => "textarea",
e061214 @splorp Added theme option to activate global announcement text
splorp authored
53 "std" => "<p>This text will appear in the announcement area.</p>"),
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
54 );
e9d3dc3 @splorp Added rudimentary theme option for global admin notice
splorp authored
55
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
56
135e209 @splorp Code formatting persnicketiness
splorp authored
57 // Tersus Theme Options Admin
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
58
59 function tersus_add_admin() {
60 global $themename, $shortname, $options;
61 if ( $_GET['page'] == basename(__FILE__) ) {
62 if ( 'save' == $_REQUEST['action'] ) {
63 foreach ($options as $value) {
64 update_option( $value['id'], $_REQUEST[ $value['id'] ] );
65 }
66 foreach ($options as $value) {
67 if( isset( $_REQUEST[ $value['id'] ] ) ) {
68 update_option( $value['id'], $_REQUEST[ $value['id'] ] );
69 } else {
70 delete_option( $value['id'] );
71 }
72 }
73 header("Location: themes.php?page=functions.php&saved=true");
74 die;
75 } else if( 'reset' == $_REQUEST['action'] ) {
76 foreach ($options as $value) {
77 delete_option( $value['id'] );
78 }
79 header("Location: themes.php?page=functions.php&reset=true");
80 die;
81 }
82 }
83 add_theme_page($themename." Options", "".$themename." Options", 'edit_themes', basename(__FILE__), 'tersus_admin');
84 }
85
86 function tersus_admin() {
87 global $themename, $shortname, $options;
7cd9afa @splorp Minor edits to theme option messages
splorp authored
88 if ( $_REQUEST['saved'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' options have been saved.</strong></p></div>';
89 if ( $_REQUEST['reset'] ) echo '<div id="message" class="updated fade"><p><strong>'.$themename.' options have been reset to their default settings.</strong></p></div>';
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
90
91 ?>
97fa80e @splorp Tidied up the theme option functions
splorp authored
92
93 <div class="wrap">
94 <div id="icon-themes" class="icon32"><br /></div>
95 <h2><?php echo $themename; ?> Options</h2>
96 <form method="post">
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
97 <table class="form-table">
98
97fa80e @splorp Tidied up the theme option functions
splorp authored
99 <?php
100 foreach ($options as $value) {
101 switch ( $value['type'] ) {
102 case 'text':
103 ?>
104
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
105 <tr>
106 <th><strong><?php echo $value['name']; ?></strong></th>
dfcff5d @splorp Theme option page formatting and nomenclature
splorp authored
107 <td><input name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" value="<?php if (get_settings($value['id']) != "") { echo get_settings($value['id']); } else { echo $value['std']; } ?>" /> <?php echo $value['desc']; ?></td>
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
108 </tr>
97fa80e @splorp Tidied up the theme option functions
splorp authored
109
110 <?php
111 break;
112 case 'textarea':
113 ?>
114
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
115 <tr>
116 <th><strong><?php echo $value['name']; ?></strong></th>
dfcff5d @splorp Theme option page formatting and nomenclature
splorp authored
117 <td><textarea name="<?php echo $value['id']; ?>" type="<?php echo $value['type']; ?>" cols="80" rows="5"><?php if (get_settings($value['id']) != "") { echo stripslashes(get_settings( $value['id'] )); } else { echo $value['std']; } ?></textarea>
118 <p><?php echo $value['desc']; ?></p></td>
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
119 </tr>
97fa80e @splorp Tidied up the theme option functions
splorp authored
120
121 <?php
122 break;
123 case 'select':
124 ?>
125
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
126 <tr>
127 <th><strong><?php echo $value['name']; ?></strong></th>
dfcff5d @splorp Theme option page formatting and nomenclature
splorp authored
128 <td><select name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>"><?php foreach ($value['options'] as $option) { ?><option<?php if (get_settings($value['id']) == $option) { echo ' selected="selected"'; } elseif ($option == $value['std']) { echo ' selected="selected"'; } ?>><?php echo $option; ?></option><?php } ?></select> <?php echo $value['desc']; ?></td>
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
129 </tr>
130
97fa80e @splorp Tidied up the theme option functions
splorp authored
131 <?php
132 break;
133 case "checkbox":
134 ?>
135
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
136 <tr>
137 <th><strong><?php echo $value['name']; ?></strong></th>
cb39e40 @splorp New theme options for page and category lists
splorp authored
138 <td><input type="checkbox" name="<?php echo $value['id']; ?>" id="<?php echo $value['id']; ?>" value="1" <?php checked(true, get_option( $value['id'] )); ?> /> <?php echo $value['desc']; ?></td>
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
139 </tr>
97fa80e @splorp Tidied up the theme option functions
splorp authored
140
141 <?php break;
142 }
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
143 }
97fa80e @splorp Tidied up the theme option functions
splorp authored
144 ?>
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
145
146 </table>
97fa80e @splorp Tidied up the theme option functions
splorp authored
147 <p class="submit">
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
148 <input name="save" type="submit" value="Save Changes" />
97fa80e @splorp Tidied up the theme option functions
splorp authored
149 <input type="hidden" name="action" value="save" />
150 </p>
151 </form>
152
153 <form method="post">
154 <p class="submit">
1481ef7 @splorp Reformatted theme options to match WordPress settings
splorp authored
155 <input name="reset" type="submit" value="Reset Options" />
97fa80e @splorp Tidied up the theme option functions
splorp authored
156 <input type="hidden" name="action" value="reset" />
157 </p>
158 </form>
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
159
160 <?php
161 }
96f841c @splorp Added function to remove classes from page list items
splorp authored
162
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
163 add_action('admin_menu', 'tersus_add_admin');
164
165 // Automatic Feed Links
166
167 automatic_feed_links();
168
ff51734 @splorp Persnickity edits to comment verbiage
splorp authored
169 // Remove non-validating parent post link from header
0647c94 @splorp Removed nonvalidating parent post link from header
splorp authored
170
171 remove_action('wp_head', 'parent_post_rel_link');
172
ff51734 @splorp Persnickity edits to comment verbiage
splorp authored
173 // Sidebar support. Let's have two, shall we?
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
174
175 if ( function_exists('register_sidebar') ) {
176 register_sidebar(array('name'=>'Sidebar1',
177 'before_widget' => '<li id="%1$s" class="widget %2$s">',
178 'after_widget' => '</li>',
179 'before_title' => '<h2 class="widgettitle">',
180 'after_title' => '</h2>',
181 ));
182 register_sidebar(array('name'=>'Sidebar2',
183 'before_widget' => '<li id="%1$s" class="widget %2$s">',
184 'after_widget' => '</li>',
185 'before_title' => '<h2 class="widgettitle">',
186 'after_title' => '</h2>',
187 ));
188 }
96f841c @splorp Added function to remove classes from page list items
splorp authored
189
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
190 // Adds support for Post Formats -- http://codex.wordpress.org/Post_Formats
191
192 add_theme_support( 'post-formats', array( 'aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat' ) );
6e99fba @splorp Added a proper thousands delimiter function for category post counts
splorp authored
193
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
194 // Replace default post class verbosity
195
196 function simple_post_class() {
197 $post = get_post($post_id);
198 $c = array();
199
200 // hentry for hAtom compliance
201 $c[] = 'hentry';
202
203 // Determine Post Format
204 $post_format = get_post_format( $post->ID );
205 if ( $post_format && !is_wp_error($post_format) ) $c[] = $post->post_type . '-' . sanitize_html_class( $post_format );
206
207 // Is it Sticky?
208 if ( is_sticky($post->ID) && is_home() && !is_paged() ) $c[] = 'sticky';
209
210 return $c;
211 }
6e99fba @splorp Added a proper thousands delimiter function for category post counts
splorp authored
212
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
213 add_filter( 'post_class', 'simple_post_class' );
214
ff51734 @splorp Persnickity edits to comment verbiage
splorp authored
215 // Remove non-validating rel attributes from category links
b4c5db3 @splorp Removed nonvalidating rel attributes from category links
splorp authored
216
217 function relfix($c) {
4cf8c36 @splorp Fixed escaped slashes appearing in category links and announcement text
splorp authored
218 return preg_replace('/category tag/','tag',$c);
b4c5db3 @splorp Removed nonvalidating rel attributes from category links
splorp authored
219 }
220
221 add_filter('the_category','relfix');
222
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
223 // Add a proper thousands delimiter to category post counts
6e99fba @splorp Added a proper thousands delimiter function for category post counts
splorp authored
224
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
225 function delim($c) {
226 return preg_replace('/(\d)(\d{3})\b/','\1,\2',$c); // Hat tip to @myfonts for the regex tweaks
227 }
6e99fba @splorp Added a proper thousands delimiter function for category post counts
splorp authored
228
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
229 add_filter('wp_list_categories','delim');
6e99fba @splorp Added a proper thousands delimiter function for category post counts
splorp authored
230
96f841c @splorp Added function to remove classes from page list items
splorp authored
231
4106d4e @splorp Consolidated class decrufting functions
splorp authored
232 // Remove crufty class and ID attributes from list elements
6e99fba @splorp Added a proper thousands delimiter function for category post counts
splorp authored
233
4106d4e @splorp Consolidated class decrufting functions
splorp authored
234 function decruft($c) {
235 $c_ = preg_replace('/ class=[\"\'].+?[\"\']/','',$c);
236 return preg_replace('/ id=[\"\'].+?[\"\']/','',$c_);
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
237 }
96f841c @splorp Added function to remove classes from page list items
splorp authored
238
4106d4e @splorp Consolidated class decrufting functions
splorp authored
239 add_filter('wp_list_bookmarks','decruft');
240 add_filter('wp_list_categories','decruft');
241 add_filter('wp_list_pages','decruft');
242 add_filter('edit_comment_link','decruft');
243 add_filter('comment_reply_link','decruft');
96f841c @splorp Added function to remove classes from page list items
splorp authored
244
94dfbde @splorp Added filter for comment_class function
splorp authored
245
b27a4c4 @splorp Renamed function for consistency
splorp authored
246 // Remove crufty class attributes from avatars
c2b4a3b @splorp Added function to remove classes from comment edit and reply links
splorp authored
247
b27a4c4 @splorp Renamed function for consistency
splorp authored
248 function decruft_avatars($str) {
249 return preg_replace('/ class=[\"\'].+?[\"\']/',' class="photo"',$str);
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
250 }
d9016c2 @splorp Comment lists now use a custom callback function
splorp authored
251
b27a4c4 @splorp Renamed function for consistency
splorp authored
252 add_filter ('get_avatar','decruft_avatars');
43b3ae0 @splorp Added function to remove extraneous avatar classes
splorp authored
253
d9016c2 @splorp Comment lists now use a custom callback function
splorp authored
254
cff16f0 @splorp Replacement gallery shortcut function
splorp authored
255 // Replacement gallery shortcut function
256 // Removes default cruft and verbosity
257
258 remove_shortcode('gallery');
259 add_shortcode('gallery', 'tersus_gallery');
260
261 // Portions by Michael Preuss and Aaron Cimolini
262 // http://snipplr.com/view.php?codeview&id=27051
263
264 function tersus_gallery($attr) {
265 global $post;
266
267 static $instance = 0;
268 $instance++;
269
270 // Check for a valid orderby statement
271 if ( isset( $attr['orderby'] ) ) {
272 $attr['orderby'] = sanitize_sql_orderby( $attr['orderby'] );
273 if ( !$attr['orderby'] )
274 unset( $attr['orderby'] );
275 }
276
277 extract(shortcode_atts(array(
278 'order' => 'ASC',
279 'orderby' => 'menu_order ID',
280 'id' => $post->ID,
281 'itemtag' => 'dl',
282 'icontag' => 'dt',
283 'captiontag' => 'dd',
284 'columns' => 3,
285 'size' => 'thumbnail',
286 'include' => '',
287 'exclude' => ''
288 ), $attr));
289
290 $id = intval($id);
291 if ( 'RAND' == $order )
292 $orderby = 'none';
293
294 if ( !empty($include) ) {
295 $include = preg_replace( '/[^0-9,]+/', '', $include );
296 $_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
297
298 $attachments = array();
299 foreach ( $_attachments as $key => $val ) {
300 $attachments[$val->ID] = $_attachments[$key];
301 }
302 } elseif ( !empty($exclude) ) {
303 $exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
304 $attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
305 } else {
306 $attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
307 }
308
309 if ( empty($attachments) )
310 return '';
311
312 if ( is_feed() ) {
313 $output = "\n";
314 foreach ( $attachments as $att_id => $attachment )
315 $output .= wp_get_attachment_link($att_id, $size, true) . "\n";
316 return $output;
317 }
318
319 // Check to see whether any tags have been set to false
320 if ($itemtag) $itemtag = tag_escape($itemtag);
321 if ($captiontag) $captiontag = tag_escape($captiontag);
322 if ($icontag) $icontag = tag_escape($icontag);
323 $columns = intval($columns);
324
325 $selector = "gallery-{$instance}";
326
327 $output = "<div id='$selector'>\n";
328
329 $i = 0;
330 foreach ( $attachments as $id => $attachment ) {
331 ++$i;
332 $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
333
334 if ($itemtag) {
335 $output .= '<'.$itemtag;
336 if( $columns > 0 && $i % $columns == 0 ) $output .= " last";
337 $output .= '">';
338 }
339 if ($icontag) $output .= "\n\t<" .$icontag. ">\t";
340 $output .= "\n\t".$link;
341 if ($icontag) $output .= "\n\t</".$icontag.">";
342 // if the attachment has a caption set
343 if ( trim($attachment->post_excerpt) ) {
344 if ($captiontag) $output .= "\n<" .$captiontag. ">\n\t";
345 $output .= wptexturize($attachment->post_excerpt);
346 if ($captiontag) $output .= "\n</" .$captiontag. ">" . "\n";
347 }
348 if ($itemtag) $output .= "\n</".$itemtag .">\n";
349 if ( $columns > 0 && $i % $columns == 0 ) $output .= "\n";
350 }
351
352 $output .= "</div>\n";
353
354 return $output;
355 }
356
357
d9016c2 @splorp Comment lists now use a custom callback function
splorp authored
358 // Replacement comment callback function
359 // Removes default class and ID verbosity
360
361 function tersus_comment($comment, $args, $depth) {
362 $GLOBALS['comment'] = $comment; ?>
363 <li id="comment-<?php comment_ID() ?>">
364 <p>Posted by <span class="vcard author"><?php echo get_avatar( $comment->comment_author_email, 48 ); ?> <?php printf(__('<cite class="fn">%s</cite>'), get_comment_author_link()) ?></span> on <a href="<?php echo esc_url( get_comment_link( $comment->comment_ID ) ) ?>" rel="bookmark" title="<?php comment_time('c') ?>"><?php comment_time('l, F jS, Y') ?></a>.</p>
365
366 <?php if ($comment->comment_approved == '0') : ?>
367 <p><em><?php _e('Your comment is awaiting moderation.') ?></em></p>
368 <?php endif; ?>
369
370 <?php comment_text() ?>
371
372 <p><?php edit_comment_link(__('Edit'),'',' | ') ?><?php comment_reply_link(array_merge( $args, array('depth' => $depth, 'max_depth' => $args['max_depth']))) ?></p>
373 <?php
374 }
375
a32ef3b @splorp Updated incline comment reply link anchors
splorp authored
376
377 // Update comment reply link anchors
378
379 function comment_reply_anchor($str) {
380 return preg_replace('/respond/', 'comment', $str);
381 }
382
383 add_filter ('comment_reply_link','comment_reply_anchor');
d9016c2 @splorp Comment lists now use a custom callback function
splorp authored
384
385
69a6344 @cdharrison Added functions to enable support of the_page_thumbnail within the RS…
authored
386 // Add support for the_post_thumbnail
96f841c @splorp Added function to remove classes from page list items
splorp authored
387
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
388 if ( function_exists( 'add_theme_support' ) ) { // Added in 2.9
389 add_theme_support( 'post-thumbnails' );
390 set_post_thumbnail_size( 600, 9999, true ); // Normal post thumbnails
391 add_image_size( 'archive-thumbnail', 50, 50 ); // Permalink thumbnail size
392 }
9fe4602 @splorp Fixed “Headers already sent” error
splorp authored
393
394 // Add support for the_post_thumbnail in RSS feeds
395
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
396 function insertThumbnailRSS($content) {
397 global $post;
398 if ( has_post_thumbnail( $post->ID ) ){
399 $content = '<p class="image">' . get_the_post_thumbnail( $post->ID, 'medium' ) . '</p>' . $content;
400 }
401 return $content;
402 }
3b967cb @splorp Added theme information constants
splorp authored
403
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
404 add_filter('the_excerpt_rss', 'insertThumbnailRSS');
405 add_filter('the_content_feed', 'insertThumbnailRSS');
3b967cb @splorp Added theme information constants
splorp authored
406
2cb5e7a @splorp Added contextual archive navigation delimiters
splorp authored
407 // Removes the link delimiter when viewing first or last post
e240851 @splorp Added contextual post navigation delimiters
splorp authored
408
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
409 function delim_post_link() {
410 $prev = get_previous_post();
411 $next = get_next_post();
412 if ( $prev && $next ) {
413 echo " | ";
414 }
e240851 @splorp Added contextual post navigation delimiters
splorp authored
415 }
416
2cb5e7a @splorp Added contextual archive navigation delimiters
splorp authored
417 // Removes the link delimiter when viewing first or last archive page
e240851 @splorp Added contextual post navigation delimiters
splorp authored
418
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
419 function delim_posts_link() {
420 $prev = get_previous_posts_link();
421 $next = get_next_posts_link();
422 if ( $prev && $next ) {
423 echo " | ";
424 }
2cb5e7a @splorp Added contextual archive navigation delimiters
splorp authored
425 }
426
427 // Removes the link delimiter when viewing first or last comment
e240851 @splorp Added contextual post navigation delimiters
splorp authored
428
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
429 function delim_comment_link() {
e240851 @splorp Added contextual post navigation delimiters
splorp authored
430
6bd2e21 @cdharrison Theme Options, Post Formats, Simple_Post_Class Updates
authored
431 $prev = get_previous_comments_link();
432 $next = get_next_comments_link();
433 if ( $prev && $next ) {
434 echo " | ";
435 }
e240851 @splorp Added contextual post navigation delimiters
splorp authored
436 }
2cb5e7a @splorp Added contextual archive navigation delimiters
splorp authored
437
097db12 @splorp Added contextual image navigation delimiters
splorp authored
438 // Removes the link delimiter when viewing first or last image
439
440 function delim_image_link() {
441
57e2fc5 @splorp Image navigation delimiters actually work now
splorp authored
442 ob_start();
443 previous_image_link();
444 $prev = ob_get_contents();
445 ob_end_clean();
446
447 ob_start();
448 next_image_link();
449 $next = ob_get_contents();
450 ob_end_clean();
451
097db12 @splorp Added contextual image navigation delimiters
splorp authored
452 if ( $prev && $next ) {
453 echo " | ";
454 }
455 }
456
d5a7ab6 @splorp Added filter to excerpt_more function
splorp authored
457 // Custom excerpt links
458
459 function new_excerpt_more($more) {
8879526 @splorp Custom excerpt links
splorp authored
460 global $post;
461 $t = get_post($post->ID);
462 $title = $t->post_title;
463 return ' … <a href="' . get_permalink($post->ID) . '" title="Read the rest of “' . $title . '”">Read the rest of this item</a>';
d5a7ab6 @splorp Added filter to excerpt_more function
splorp authored
464 }
465
466 add_filter('excerpt_more', 'new_excerpt_more');
467
39f9af7 @splorp Added simple_post_class function to replace post_class verbosity
splorp authored
468 ?>
Something went wrong with that request. Please try again.