skip to Main Content

The built in php wordpress functions are not reading in my VScode and its really bugging me because it is showing yellow/orange swiggly lines.

    <h2><a href="<?php the_permalink();?>"><?php the_title(); ?></a></h2>
    <?php the_content();?>
    <hr>
<?php }

get_footer();
?>

Word Press functions not registering in VScode

Word Press functions not registering in VScode

3

Answers


  1. Chosen as BEST ANSWER

    I figured it out. It turns out I needed to open the PHP files in my root folder in order for the WordPress functions to be acknowledged by VScode.


  2. if this could help someone facing the same issue, here is what worked for me:

    1. download PHP_Intelephense Here if not already installed.

    2. Then in VsCode go to : settings (ctr+,) > Extensions >Intelephense,

    then find your intelephense.stubs, add WordPress and save changes.
    See this screen shot

    1. Restart your VsCode and Voila !
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search