Answer the question
In order to leave comments, you need to log in
How to make php work in wordpress page editor?
Good afternoon, I insert the code into the vp page editor, html works, and php comments on the browser. Why?
Here is an example from the console. The code was not originally like this.
How to make the function work? (You need to display post thumbnails. If php cannot be inserted into the page editor, is it possible to display thumbnails in another way?)
Answer the question
In order to leave comments, you need to log in
Hello!
1) It is strongly not recommended to insert PHP code into the editor. But if you really want to, then the Exec PHP plugin or Allow PHP Execute (I don’t know if they work, because they are outdated).
2) The correct way to add a PHP code on a page is by creating a shortcode, and insert the shortcode into the content. More details - https://wp-kama.ru/function/add_shortcode
Or you can insert PHP code into a template and assign this template to a page or post...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question