You can’t load template files directly. WordPress is not loaded in that context, so you have no access to its functions. Create a page in WordPress admin, and assign your template to that page, then point your link to that page rather than directly to the template file.
Related Posts:
- Getting headers already sent error from plugin
- Error messages when adding code to function.php or trying to delete inactive plugin files
- Call to undefined function get_header() in index.php
- “Cannot modify header information” means I can’t use wp_redirect
- White Screen on Site but wp-admin OK
- Multiple use wp_logout_url() on page cause ‘header already sent’ error after submit form
- Why I am having error Call to undefined function get_header()?
- Error Message – Cannot login to WordPress
- Cannot access non-wordpress subdirectories as wordpress overrides them with a 404 error
- Change login error messages
- Notice: Undefined index: host in /var/www/html/wp-includes/canonical.php on line 445
- Notice: Constant WP_POST_REVISIONS already defined
- How to stop certain warning logging in error.log?
- Error 404 Page Not Found When Updating a Post or Page
- Debug mode shows Strict Standards
- Why on Earth am I getting “undefined_index” errors?
- Debugging ‘Object of class WP_Query could not be converted to int’ error
- Displaying oEmbed errors?
- “Apache HTTP Service has stopped working” with WP Query in WordPress 2.9.2
- Showing “ Notice: Undefined variable:” and “ Notice: Trying to get property of non-object”
- Publishing Time – WordPress Plain White Screen with No Error
- Sodium compat error
- Fatal error: require(): Failed opening required ‘WP_DIRwp-blog-header.php’
- add_sub_menu page() to be replaced by add_theme_page()
- Removing warnings and notices from production servers
- : Failed to load resource
- What does this error mean? WordPress database error: [MySQL server has gone away]
- Fatal error: Call to undefined function is_multisite()
- WordPress white screen with word ‘error’ [closed]
- File does not exist – wp-index.php
- REST : how do you handle the rest_no_route error?
- I need https::/mysite.com instead of https::/mysite.com/wordpress
- Nginx 404, 500 errors and WordPress
- Warning: Invalid argument supplied for foreach() in portfolio-list.php [closed]
- “Undefined index” in wp-includes/media.php
- Can’t post to my WordPress site
- Error message prevents access to WP
- I could not access my website wp-admin after installing SSL. And error with mixed content
- Page Not Found on categories / tags / pages
- is there any function to store logs & send mail to admin?
- Visual editor become blank after updating an article
- wp_remote_get sslv3 alert handshake failure
- Getting notices on fresh 3.6.1 install
- Headers already sent in Pluggable.php / homepage and wp-login error
- Error after moving WordPress installation
- Declare Global Variable In OOP PHP
- How can I fix buggy WordPress dashboard [duplicate]
- I was adding the custom CSS & JS using hooks and there was this error even I didn’t touch the wp-class-hook
- Why can I not execute php files under the wp-includes folder?
- Enqueued stylesheet appends query string, causing “SyntaxError: Invalid or unexpected token”
- WordPress custom plugin gives error
- Can’t access my site please help
- WP displays “some_strange_number Version” in the bottom right corner
- @file_get_contents and wp_remote_get
- Headers already sent by
- Failed: Filesystem preventing downloads. ( ftpext)
- Code snippet to display ID gives critical error
- error log bloated by add_view
- Unable to locate WordPress content directory
- WP Core Update Issue
- Cannot upgrade to 4.0 – get SSL certificate error
- Error when setting cookie
- Downgrade from latest nightly build to latest stable version
- styles/default.css in markup, where does it come from? [closed]
- download count29.php whene loading site [closed]
- Warning: call_user_func_array() [function.call-user-func-array]
- Parse error: syntax error, unexpected [closed]
- My new WordPress blog keeps refreshing in Chrome browser
- Need Help Determining Where Header Error is Happening
- Getting no Error Log File saved to my local directory, and no debug info displayed in the web browser
- How to turn off WP error handling, but turn on php error handling?
- Help with “Uncaught Error: Attempt to modify property “response” on bool”
- Error regarding invalid file permissions for upgrading WordPress version
- Replace form field error text?
- Publication in wrong category
- Suddenly get errors in admin when editing post type
- Modifying server’s response to API endpoint
- How can I make error messages in admin
- WordPress won’t save page/post with more than 332 words
- Dashboard widget, screen options/help doesn’t work?
- Getting amp; on every single category, post and page title. How to Remove?
- Site has fake users registered with a similar pattern in username and email
- WordPress fails when my post is larger than 1400 words
- Seeing “error” as text on white when accessing admin
- Weird Parse Error on Uploaded File
- do_action( ‘init’ ) in wp-settings.php breaks my website. All plugins and themes disabled
- WP_Error message
- Avoiding “headers already sent” in WordPress
- Fatal error: Cannot declare class WP_User_Request, because the name is already in use?
- Unexpected error with class-wp-hook.php on WordPress
- Fatal error: Call to undefined function wp_raise_memory_limit()
- problem ajaxurl – designthemes-core-features
- WordPress “Allowed memory size” on wp-db.php [closed]
- Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ [closed]
- Whole right area of wordpress admin dashboard not showing
- Only specific users timing out
- WordPress Customizer not loading
- Fatal error: Uncaught Error: trim(): Argument #1 ($string) at \wp-includes\class-wp-query.php
- Unable to log in: “Cannot serve directory www/wordpress/wp-includes/ No matching DirectoryIndex”
- How do I turn off WordPress errors and just have regular old php errors?