K
K
Khabib Omarov2020-06-27 10:04:44
PHP
Khabib Omarov, 2020-06-27 10:04:44

How to display the_excerpt stripped of html tags?

By default, the_excerpt() outputs 50 lines from the article, and appends to the tags and ends with [...].
You need to make sure that the_excerpt() outputs just text, without any html tags.
Tried like this:

$text = the_excerpt();
echo strip_tags($text);

But it didn't give any results.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima Polos, 2020-06-27
@temp-market

echo get_the_excerpt()

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question