Answer the question
In order to leave comments, you need to log in
How to make VS code understand Wordpress code?
I'm learning to pull the layout on Wordpress.
All code is highlighted in red:
There are no errors in the code.
As far as I'm guessing, the IDE doesn't recognize the Wordpress code.
Here is what is displayed in the terminal:
Can you please tell me how to fix this?
Answer the question
In order to leave comments, you need to log in
What else is "Wordpress code"? What did you come up with? This is normal php.
In fact, as already suggested, this is a regular php.
Therefore, it is necessary to approach both php.
Personally, I have the PHP Intelephense
extension.
To make it convenient to work and not have a clutter of directories, you need to use the workspace, i.e.
- Add your working folder.
- Add the working folder where wordpress is installed as a separate folder. It is desirable to have a separate copy of WP on disk, then the search will not be duplicated
. As a result, there is a general search, there is a search in directories, the transition to the function definition works.
Just throw the entire wordpress folder into vscode and it will automatically pull up all the core functions. No add-ons need to be installed.
Install a WordPress plugin. The latest version of vscode has them
Vscode is NOT an IDE, it's a code editor like notepad++, it's just cooler because there are a lot of extensions.
Even in phpstorm you need to add plugins in order for the functions and hints for wordpress to work properly. The same applies to other frameworks or cms.
But by screwing a few extensions, you can make it so that everyone understands
. For example, like here: https://marketplace.visualstudio.com/items?itemNam...
Inside there are links to additional extensions
Here is also an interesting reading: https://github.com /WordPress/WordPress-Coding-Stan...
wordpress, like php itself, has not been so simple for a long time... especially if you want to write modern, correct code according to standards.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question