A
A
Amir2017-07-03 10:13:52
Web development
Amir, 2017-07-03 10:13:52

How to format the Extended part of a post?

Good afternoon, dear ones.
Faced the following problem:
If you display the content of the post through
the_content();
then everything is in order, all html tags are present. But my task is to split the post into text before more and after. Accordingly, I use the get_extended() function. But when I try to display what's after more, the text is solid, without tags (even p).
I do it like this:

global $post;
$post_parts = get_extended($post->post_content);
echo $post_parts['extended'];

If we use the_content() then when viewing with the developer tool we see the following lines:
<p>Первая строка</p>
<p>Вторая строка</p>

And if so, as I described above, then it turns out:
Первая строка Вторая строка
What to do? How to format text?
Thanks in advance for the replies.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DevMan, 2018-12-11
@Cheizer

https://developer.mozilla.org/ru/docs/Web/API/Hist...

I
Igor Vorotnev, 2017-07-03
@Guedda

Try using instead

echo apply_filters( 'the_content', $post_parts['extended'] );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question