WordPress.org

Ready to get started?Download WordPress

Forums

Custom Files & Headers, Footers and Sidebar (2 posts)

  1. Subfusion
    Member
    Posted 8 years ago #

    I'm developing a new WP theme for my website and I've got some custom files which pull out information out of the WP database differently to the way WP does it on the homepage.

    On these pages I still want to use WP templates such as the header, footer and sidebar. But when I try to call them I get the following error:

    Fatal error: Unknown function: get_header() in /home/*****/public_html/*****/wp-content/themes/evibes/about.php on line 1

    Obviously I have to add an include on this file that calls the main WP files, is there a way round to this?

  2. moshu
    Member
    Posted 8 years ago #

    If you want to use WP functions in a non-WP file (like "get_header") you need to add this at the top of those files, before everything else:
    <?php
    require('./path-to-your-blog/wp-blog-header.php');
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.