Support » Fixing WordPress » How to bold first 20 words in excerpt

Viewing 1 replies (of 1 total)
  • Michael

    (@alchymyth)

    Forum Moderator

    instead of <?php the_excerpt(); ?> try to insert this snippet:

    <?php
    $text = explode(' ',get_the_excerpt());
    $text[0]='<strong>'.$text[0];
    $text[19]=$text[19].'</strong>';
    echo apply_filters('the_excerpt',implode(' ',$text));
    ?>
Viewing 1 replies (of 1 total)
  • The topic ‘How to bold first 20 words in excerpt’ is closed to new replies.