Visual Studio Code - Local

This may not be a Local problem. i have a Wordpress site set up on my browser. I am learning PHP using VSC. When I run the code I get an unrecognized function error for have_post() function so I assume VSC does not recognize the dependency files in Wordpress. The VSC code is using the files created for the Wordpress set up by Local,

Can I have the VSC software recognize the wordpress files to use the wordpress functions ?

Hi @STerry

It seems like we’ve had other users run into this issue. This thread might help you here: How to link LocalWP PHP and Composer installations to VSCode?

Thanks nick-B, my problem isn’t a PHP problem, my problem is that VSC doesn’t recognize the function files in wordpress so it doesn’t acknowledge the standard wordpress functions.


Hi @STerry

Thank you for the clarification, sorry for my misunderstanding there. Our friends at Delicious Brains have an article that might help you more here: Turn Visual Studio Code into the Ultimate Editor for WordPress Development

Great I will look it up. Thanks for your help. Terry

1 Like

Not sure if it’s helpful but there is no have_post() function. It’s either have_posts() plural or the_post() singular.

Thanks, you’re correct but I did have have_posts() in the code. The problem is that it doesn’t recognize any wordpress. function. I received info on an article from Delicious Brains that I haven’t had time to work with but I think it will fix the problem. Thank you for taking the time to respond. Please keep watching as I have a lot of questions.



This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.