Forums

Fatal error: Call to undefined function: get_sidebar() (3 posts)

  1. field4kids
    Member
    Posted 5 years ago #

    I've written a php file, faq.php, that is in my /blog directory that reads my MySQL database and gets all my FAQ category posts. I'm trying to call get_sidebar() and get_footer() from this program (faq.php) but I'm getting the error:

    "Fatal error: Call to undefined function: get_sidebar() in /home/content/f/i/e/field4kids/html/blog/faq.php on line 92"

    What am I doing wrong? Do I need to add a path somewhere so the faq.php can find the function?

    Thanks for any help,
    Larry

  2. moshu
    Member
    Posted 5 years ago #

    Yep. Put this on the top of that file, before everything:
    <?php
    require('./path-to-your-blog/wp-blog-header.php');
    ?>

  3. field4kids
    Member
    Posted 5 years ago #

    Thanks! That fixed it.

Topic Closed

This topic has been closed to new replies.

About this Topic