Plugin Directory

Changeset 492207


Ignore:
Timestamp:
01/19/2012 05:05:28 PM (14 years ago)
Author:
fred91
Message:
 
Location:
simplicy-post-view/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • simplicy-post-view/trunk/readme.txt

    r488204 r492207  
    3737
    3838= 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
    4040
  • simplicy-post-view/trunk/simplicy-post-view.php

    r488204 r492207  
    22/*
    33 * Plugin Name: Simplicy post view
    4  * Version: 1.6
     4 * Version: 1.7
    55 * Plugin URI: http://plugins.svn.wordpress.org/simplicy-post-view/
    66 * Description: afficher vos article avec miniature dans votre sidebar.
     
    6363            echo $before_title . $title . $after_title;
    6464                       
    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 (...)
     79function custom_excerpt_more() {
     80    global $post;
     81    return '<a href="'. get_permalink($post->ID) . '">' . ' ... &raquo;' . '</a>';
     82}
     83add_filter('excerpt_more', 'custom_excerpt_more');     
    6684
    6785       
     
    97115
    98116                    <?php if ( $instance['excerpt'] ) : ?>
    99                     <?php the_excerpt(); ?>
     117                     <?php echo excerpt_simplicy($instance["excerpt_length"]); ?>
    100118                   
    101119                    <?php endif; ?>
     
    269287}
    270288
    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) . '">' . ' ... &raquo;' . '</a>';
    280 }
    281 add_filter('excerpt_more', 'custom_excerpt_more');
     289
    282290
    283291/**
Note: See TracChangeset for help on using the changeset viewer.