• I’m having an issue where I get an error using WP_Query because it is in a separate PHP file that is called using include_once

    The error is Fatal error: Class ‘WP_Query’ not found in …

    In the sidebar.php file where it works perfectly but when I call up another PHP file (called sidebar_ads.php) it give me the error code.

    I have tried by adding the contents of the new file in the same spot on the sidebar.php file and everything works fine

  • The topic ‘WP_Query() brings an error code when used in a seperate file called in Sidebar’ is closed to new replies.