• icstee

    (@icstee)


    Hi guys! I have a problem. I remade the index, and i added the function wp_trim_words for excerpt the articles in index. The problem is that the shartcodes are showing and what are between them. How can i remove those shortcodes and what are between them from index.

    This is the code i use to get the words in index:

    <?php
    
    $content = get_the_content(__('<span style="color:black; text-align:justify; text-decoration: none; font-weight: normal;"> ...</span>'));
    $trimmed_content = wp_trim_words( $content, 65, ' ...' );
    echo $trimmed_content;
    
    ?>

    Example picture.

    Thank you!

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to remove the shortcodes and what are inside them, in index’ is closed to new replies.