Web Hosting
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

WordPress fix Reply To: Remove/hide specific word from excerpt?

Discussion in 'Misc WordPress Requests' started by catmaniax, Oct 24, 2017.

  1. catmaniax

    Guest

    Reply To: Remove/hide specific word from excerpt?, by catmaniax

    I didn’t use any different code, I just don’t know how to make the two codes you gave me both work.

    function my_clean_excerpt( $excerpt ) {
    $badwords = array(
    'word1',
    'word2',
    'word3',
    );
    foreach ( $badwords as $badword ) {
    $excerpt = str_replace( $badword, '', $excerpt);
    }
    return $excerpt;
    }
    add_filter( 'get_the_excerpt', 'my_clean_excerpt' );

    $excerpt .= " just one more thing... "
    return $excerpt;

    Reply To: Remove/hide specific word from excerpt?
     
    #1

Share This Page

Web Hosting