D
D
Denis2020-06-03 16:31:26
WordPress
Denis, 2020-06-03 16:31:26

How to output text from wordpress visual editor to template (archive)?

You need to output the text from the visual editor of one page to the archive template. How can I do it?

I know that get_the_content / the content functions are used in WP for this. But I can't connect them intelligibly. As I understand it, this is a matter of syntax, rather than logic. Logically, everything is simple (as it seems to me), - we bind to the ID of the page with the text and bind the the_content function. With posts, everything is simple - they have an ID, but it is not in the visa editor. In general, help pzhl, I will be very grateful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Sedov, 2020-06-03
@Cobra8106

$post_id = get_post(30);
$content = $post_id->post_content;
echo $content;

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question