Changeset 492207
- Timestamp:
- 01/19/2012 05:05:28 PM (14 years ago)
- Location:
- simplicy-post-view/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (1 diff)
-
simplicy-post-view.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
simplicy-post-view/trunk/readme.txt
r488204 r492207 37 37 38 38 = Version 1.0 (21/05/2011) =<br /> = Version 1.1 (27/06/2011) =<br /> = Version 1.2 (28/10/2011) = = Fixed minor bugs and add css style sheet= <br />= Version 1.3 (18/11/2011) = = Fixed minor bugs = <br />= Version 1.4 (3/12/2011) = = Fixed bugs Excerpt = 39 <br />= Version 1.5 (16/12/2011) = = adding option Select all category <br /> Version 1.6 (11/01/2012) = = Fixed bugs excerpt 39 <br />= Version 1.5 (16/12/2011) = = adding option Select all category <br /> Version 1.6 (11/01/2012) = = Fixed bugs excerpt <br /> Version 1.7 (19/01/2012) = = change function excerpt 40 40 -
simplicy-post-view/trunk/simplicy-post-view.php
r488204 r492207 2 2 /* 3 3 * Plugin Name: Simplicy post view 4 * Version: 1. 64 * Version: 1.7 5 5 * Plugin URI: http://plugins.svn.wordpress.org/simplicy-post-view/ 6 6 * Description: afficher vos article avec miniature dans votre sidebar. … … 63 63 echo $before_title . $title . $after_title; 64 64 65 65 // Excerpt length filter 66 function excerpt_simplicy($limit) { 67 $excerpt = explode(' ', get_the_excerpt(), $limit); 68 if (count($excerpt)>=$limit) { 69 array_pop($excerpt); 70 $excerpt = implode(" ",$excerpt).'...'; 71 } else { 72 $excerpt = implode(" ",$excerpt); 73 } 74 $excerpt = preg_replace('`\[[^\]]*\]`','',$excerpt); 75 return $excerpt; 76 } 77 78 // modification affichage excert (...) 79 function custom_excerpt_more() { 80 global $post; 81 return '<a href="'. get_permalink($post->ID) . '">' . ' ... »' . '</a>'; 82 } 83 add_filter('excerpt_more', 'custom_excerpt_more'); 66 84 67 85 … … 97 115 98 116 <?php if ( $instance['excerpt'] ) : ?> 99 <?php the_excerpt(); ?>117 <?php echo excerpt_simplicy($instance["excerpt_length"]); ?> 100 118 101 119 <?php endif; ?> … … 269 287 } 270 288 271 // Excerpt length filter 272 $new_excerpt_length = create_function('$length', "return " . $instance["excerpt_length"] . ";"); 273 if ( $instance["excerpt_length"] > 0 ) 274 add_filter('excerpt_length', $new_excerpt_length); 275 276 // modification affichage excert (...) 277 function custom_excerpt_more() { 278 global $post; 279 return '<a href="'. get_permalink($post->ID) . '">' . ' ... »' . '</a>'; 280 } 281 add_filter('excerpt_more', 'custom_excerpt_more'); 289 282 290 283 291 /**
Note: See TracChangeset
for help on using the changeset viewer.