0

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

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
  • Might be related to this issue: https://stackoverflow.com/questions/59890854/vs-code-highlighted-all-my-wordpress-function-name – Pog Le Pog Jul 05 '22 at 13:21

3 Answers3

2

I suggest to install a specific extension:

https://marketplace.visualstudio.com/items?itemName=johnbillion.vscode-wordpress-hooks

hhh
  • 394
  • 2
  • 15
  • I downloaded it but it still says "call to unknown function" on all WordPress related functions. – Tanner Bindrup Jul 05 '22 at 16:12
  • Try with one of these solutions from a previous discussion: https://stackoverflow.com/questions/59890854/vs-code-highlighted-all-my-wordpress-function-name – hhh Jul 06 '22 at 07:16
1

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 !
Hassan T.
  • 11
  • 2
0

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.