• I have made a custom page (a child of a Buddypress theme) and placed it in my themes folder. I can select the page in the Admin Page panel.

    I get errors on all WP functions such as get_post(), get_header(), $wpdb functions, etc:

    Fatal error: Call to undefined function get_post() in /Volumes/iMacWS/ws/wp/wp-content/themes/buddychild/ajax-handler.php on line 9

    If I set an include path for, say, $wpdb, I also get an error:
    include_once (“/Volumes/iMacWS/ws/wp/wp-includes/wp-db.php”);

    Fatal error: Call to undefined function wp_die() in /Volumes/iMacWS/ws/wp/wp-includes/wp-db.php on line 1039

    I’m obviously doing something wrong. How can I access WP functions from within a page?

    Thanks in advance.

  • The topic ‘Fatal error: get_header() and other wp functions do not work in custom template’ is closed to new replies.