Muhammad Imran Tariq
Muhammad Imran Tariq

Reputation: 23352

Wordpress custom page

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()

Upvotes: 0

Views: 186

Answers (1)

Dejan Marjanović
Dejan Marjanović

Reputation: 19380

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

Upvotes: 3

Related Questions