Skip to main content
Tweeted twitter.com/#!/StackWordPress/status/295970365010763776
added 522 characters in body
Source Link
hiiambo
  • 71
  • 1
  • 3
  • 11

I'm using a plugin to allow for dropcaps for the first letter in my Wordpress theme. However, the excerpt is cutting off the first letter. For example, a sentence like: "This is a Wordpress install" would display on the front page as "his is a Wordpress install".

I tried stripping out the strip_shortcodes section of the formatting.php but now there is a space before and after the letter so it displays as: " T his is a Wordpress install".

Does anyone know how to either a) make it display the drop cap or b)show the letter normally?

function wp_trim_excerpt($text = '') {
$raw_excerpt = $text;
if ( '' == $text ) {
    $text = get_the_content('');
    //$text = strip_shortcodes( $text );
    $text = apply_filters('the_content', $text);
    $text = str_replace(']]>', ']]>', $text);
    $excerpt_length = apply_filters('excerpt_length', 55);
    $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
    $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);

}

I'm using a plugin to allow for dropcaps for the first letter in my Wordpress theme. However, the excerpt is cutting off the first letter. For example, a sentence like: "This is a Wordpress install" would display on the front page as "his is a Wordpress install".

I tried stripping out the strip_shortcodes section of the formatting.php but now there is a space before and after the letter so it displays as: " T his is a Wordpress install".

Does anyone know how to either a) make it display the drop cap or b)show the letter normally?

I'm using a plugin to allow for dropcaps for the first letter in my Wordpress theme. However, the excerpt is cutting off the first letter. For example, a sentence like: "This is a Wordpress install" would display on the front page as "his is a Wordpress install".

I tried stripping out the strip_shortcodes section of the formatting.php but now there is a space before and after the letter so it displays as: " T his is a Wordpress install".

Does anyone know how to either a) make it display the drop cap or b)show the letter normally?

function wp_trim_excerpt($text = '') {
$raw_excerpt = $text;
if ( '' == $text ) {
    $text = get_the_content('');
    //$text = strip_shortcodes( $text );
    $text = apply_filters('the_content', $text);
    $text = str_replace(']]>', ']]>', $text);
    $excerpt_length = apply_filters('excerpt_length', 55);
    $excerpt_more = apply_filters('excerpt_more', ' ' . '[...]');
    $text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
return apply_filters('wp_trim_excerpt', $text, $raw_excerpt);

}

Source Link
hiiambo
  • 71
  • 1
  • 3
  • 11

First letter cutting off in excerpt

I'm using a plugin to allow for dropcaps for the first letter in my Wordpress theme. However, the excerpt is cutting off the first letter. For example, a sentence like: "This is a Wordpress install" would display on the front page as "his is a Wordpress install".

I tried stripping out the strip_shortcodes section of the formatting.php but now there is a space before and after the letter so it displays as: " T his is a Wordpress install".

Does anyone know how to either a) make it display the drop cap or b)show the letter normally?