Forums

WP_Query() brings an error code when used in a seperate file called in Sidebar (1 post)

  1. MikeonTV
    Member
    Posted 10 months ago #

    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

Reply

You must log in to post.

About this Topic

Tags

No tags yet.