0

I want to make new custom page in wordpress where I can communicate with database and show results. I added one in root folder. It appears; but when I try to display menu, headers. It gives error.

Fatal error: Call to undefined function get_header()
2
  • 2
    Why you don't say? An error, really? Commented Dec 23, 2011 at 16:13
  • question updated. How can I add page? Please.... Commented Dec 23, 2011 at 16:16

1 Answer 1

3

Add Template Name: (some name) comment on top of script, and when you add new page in admin, select your new template. Also, this PHP script needs to be in /wp-content/themes/(theme-name)/ folder.

<?php
/*
Template Name: Portfolio
*/
?>
<?php get_header(); ?>

Here:

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Where can I open this image you attached.
There is no template drop down in my wordpress admin.
@imi All Pages --> Add New (bottom right) OR if page exists: All Pages --> Quick Edit (right)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.