Search code examples
wordpress-themingvisual-studio-codewordpress-plugin-creation

how to avoid errors in vscode when making a wordpress theme?


How to avoid errors due to not having the specific functions of wordpress inside the projet when making a Wordpress Theme on Visual Studio Code ?

Is there a plugin to download ?

Errors vscode wordpress


Solution

  • Wordpress stubs are included in In VSCode.

    You just need to activate it.

    If you follow these steps your errors will disapear.

    1. Hit the gear icon.(bottom left)
    2. Select settings.
    3. Search for stubs.
    4. Scroll all the way down an click on 'Add item'.
    5. Hit the dropdown menu.
    6. Press w(on your keyboard) and scroll to worpress and select it.
    7. Hit ok.

    Now all the error should disapear.

    If not, try to restart VSCode.