Return to Support

Cannot pull header or footer when making stand alone php pages

Home Forums Graphene WordPress theme Support Cannot pull header or footer when making stand alone php pages

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8467
    foxhunter
    Member

    I am trying to embed an html page into a stand alone php page, but I always get an error as if the header (or footer) cant be called:

    Copied from page.php

    <?php
    /**
    * The Template for displaying all single pages.
    */

    get_header(); ?>

    <?php
    /* Run the loop to output the pages.
    * If you want to overload this in a child theme then include a file
    * called loop-page.php and that will be used instead.
    */
    include("results.html")
    ?>

    <?php get_footer(); ?>

    I put the php page in the root directory, but get the following message when trying to access it:

    Fatal error: Call to undefined function get_header() in /home/EXAMPLE/public_html/page.php on line 6

    #41228
    Prasanna SP
    Member

    get_header() is a WordPress function, not a native PHP function. So you can’t use it in a standalone PHP page.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.