Forums

2.7 - Is there a Post abbreviation Plugin that works? (4 posts)

  1. wholesalepride
    Member
    Posted 3 years ago #

    Evermore and post teaser work fine until trying to change the settings. With both, when saving the changes you get a php error that is not helpful. Anyone know of a fix, or replacement plugin?

  2. Len
    Member
    Posted 3 years ago #

    I'm not familiar with those plugins but if you're simply wanting to show snippets of your post on the front page you don't need a plugin. Use the template tag the_excerpt() instead of the_content()

    Additionally, WordPress by default will limit excerpts to 55 characters when using the_excerpt(). You can change that by adding this to your theme's functions.php file,

    /* custom trim excerpt lenghts */
    remove_filter('get_the_excerpt', 'wp_trim_excerpt');
    add_filter('get_the_excerpt', 'custom_trim_excerpt');
    
    function custom_trim_excerpt($text) { // Fakes an excerpt if needed
    global $post;
    if ( '' == $text ) {
    $text = get_the_content('');
    $text = apply_filters('the_content', $text);
    $text = str_replace(']]>', ']]>', $text);
    $text = strip_tags($text);
    $excerpt_length = X;
    $words = explode(' ', $text, $excerpt_length + 1);
    if (count($words) > $excerpt_length) {
    array_pop($words);
    array_push($words, '...');
    $text = implode(' ', $words);
    }
    }
    return $text;
    }

    Just adjust the line $excerpt_length = X; to whatever you want.

  3. Bennett McElwee
    Member
    Posted 2 years ago #

    Evermore has just been updated - the problem should now be fixed.

  4. gofree
    Member
    Posted 2 years ago #

    Yes, look great now.

    The problem we are using such plugin is because we don't want to mess up. @bennettmcelwee, great if this plugin also includes some functions like strip out images and video, too.

Topic Closed

This topic has been closed to new replies.

About this Topic