When using excerpts on a Archive or Category page, the last Word of the excerpt is dropped.
This is due to an error in the functions.php.
Instead of
PHP Code:
// Custom Excerpts
function bfa_wp_trim_excerpt($text) { // Fakes an excerpt if needed
global $bfa_ata;
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text, $bfa_ata['dont_strip_excerpts']);
$excerpt_length = $bfa_ata['excerpt_length'];
$words = explode(' ', $text, $excerpt_length + 1);
} else {
$words = explode(' ', $text);
}
if (count($words) > $excerpt_length) {
array_pop($words);
$custom_read_more = str_replace('%permalink%', get_permalink(), $bfa_ata['custom_read_more']);
$custom_read_more = str_replace('%title%', the_title('','',FALSE), $custom_read_more);
array_push($words, $custom_read_more);
$text = implode(' ', $words);
}
return $text;
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'bfa_wp_trim_excerpt');
PHP Code:
// Custom Excerpts
function bfa_wp_trim_excerpt($text) { // Fakes an excerpt if needed
global $bfa_ata;
$excerpt_length = $bfa_ata['excerpt_length'];
if ( '' == $text ) {
$text = get_the_content('');
$text = apply_filters('the_content', $text);
$text = str_replace(']]>', ']]>', $text);
$text = strip_tags($text, $bfa_ata['dont_strip_excerpts']);
$words = explode(' ', $text, $excerpt_length + 1);
$add_read_more = (count($words) > $excerpt_length);
} else {
$words = explode(' ', $text);
$add_read_more = true;
}
if ($add_read_more) {
if (count($words) > $excerpt_length)
array_pop($words);
$custom_read_more = str_replace('%permalink%', get_permalink(), $bfa_ata['custom_read_more']);
$custom_read_more = str_replace('%title%', the_title('','',FALSE), $custom_read_more);
array_push($words, $custom_read_more);
$text = implode(' ', $words);
}
return $text;
}
remove_filter('get_the_excerpt', 'wp_trim_excerpt');
add_filter('get_the_excerpt', 'bfa_wp_trim_excerpt');
But I do not like the behaviour to not print a link to the original article. Thus I replaced
PHP Code:
$add_read_more = (count($words) > $excerpt_length);
PHP Code:
$add_read_more = true;
Cheers,
nightware