Title: cannot &#8220;get_archives&#8221; from a php include file
Last modified: August 18, 2016

---

# cannot “get_archives” from a php include file

 *  [jgurley](https://wordpress.org/support/users/jgurley/)
 * (@jgurley)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/cannot-get_archives-from-a-php-include-file/)
 * I’ve just relaunched my site: [deeplyshallow.com](http://www.deeplyshallow.com)
 * In the previous version of my site, in a sidebar on the main index template I
   would display the ten most recent entries.
 * In the updated version I’ve moved that list of recent entries to a separate file.
   I’m then using a PHP include statement to display that file in a sidebar.
 * Here is the include file: [http://www.deeplyshallow.com/includes/column2_entries.php](http://www.deeplyshallow.com/includes/column2_entries.php)
 * However, instead of seeing the list of recent entries, there’s an error message
   where the include file should display. It reads:
 * > Fatal error: Call to undefined function: get_archives() in /home/jason/public_html/
   > includes/column2_entries.html on line 10
 * I don’t know how to tell the include file to reference my WP database. Can anybody
   tell me how to set this file up so that it does what I’d like it to?

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/cannot-get_archives-from-a-php-include-file/#post-339915)
 * Being outside of your WP install it doesn’t “know” what the WP-specific function
   is.
    Make the file ‘WP-aware’ – put on the top of it:
 * `<?php 
    require('./path-to/your-blog/wp-blog-header.php'); ?>
 *  Thread Starter [jgurley](https://wordpress.org/support/users/jgurley/)
 * (@jgurley)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/cannot-get_archives-from-a-php-include-file/#post-339916)
 * What if I’m not using a theme, and therefore not using wp-blog-header.php?
 *  Thread Starter [jgurley](https://wordpress.org/support/users/jgurley/)
 * (@jgurley)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/cannot-get_archives-from-a-php-include-file/#post-339918)
 * Strike that — your fix worked. Thanks very much!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘cannot “get_archives” from a php include file’ is closed to new replies.

## Tags

 * [archives](https://wordpress.org/support/topic-tag/archives/)
 * [database](https://wordpress.org/support/topic-tag/database/)
 * [get](https://wordpress.org/support/topic-tag/get/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [jgurley](https://wordpress.org/support/users/jgurley/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/cannot-get_archives-from-a-php-include-file/#post-339918)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
