I’m trying to add custom template to my WordPress theme, which would be static “About” page template. I create about.php file in my twentytwelve folder and put inside content like:
<?php get_header(); ?>
blah blah page content
<?php get_footer(); ?>
When I open this file in browser, I get error “Fatal error: Call to undefined function get_header() in *site_folder_name*wp-contentthemestwentytwelveabout.php on line 2”.
How can I fix this issue?
First Add a tamplate name in top of your page code:
And so in the wordpress dashboard:
pages
->your page
-> click onquick edit
and chooseAbout Page
template as your page template.Read more about
Page Templates
in wordpress codex: http://codex.wordpress.org/Page_TemplatesI think you should start from the very minimum wordpress template so that you get the hang of it.
There is a very good tutorial available on this:
http://www.siteground.com/tutorials/wordpress/wordpress_create_theme.htm
The problem you are experiencing, I think, is because you are working by editting an existing template with all of it’s own additional code.