<?php


/***********************************************************************************************/

/* the numbers of litter to show */

/***********************************************************************************************/
//function get_excerpt($count)
//{
//    global $post;
//
//    //$permalink = get_permalink($post->ID);
//
//    $excerpt = get_the_content();
//
//    $excerpt = strip_tags($excerpt);
//
//    $excerpt = substr($excerpt, 0, $count);
//
//    $excerpt = substr($excerpt, 0, strripos($excerpt, " "));
//
//    $excerpt = $excerpt;
//
//    return $excerpt;
//
//}


function get_excerpt($count) {
    global $post;
    $text = get_the_content();
    if ( '' != $text ) {
        $text = strip_shortcodes( $text );
        $text = apply_filters('the_content', $text);
        $text = str_replace(']]>', ']]>', $text);
        $excerpt_length = $count; // 20 words
        $excerpt_more = apply_filters('excerpt_more', ' ' . '...');
        $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
    }
    return apply_filters('the_excerpt', $text);
}

