Title: Call to undefined function query_posts()
Last modified: August 20, 2016

---

# Call to undefined function query_posts()

 *  [blasher](https://wordpress.org/support/users/blasher/)
 * (@blasher)
 * [14 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-query_posts/)
 * i want to modify index.php in my theme to display the most recent post from each
   of several categories.
 * so, i created a few different include files. first one is loop-index-projects.
   php, another is loop-motor-sports-news.php, etc. each one has a very basic example
   of the loop with a query_posts before it and a reset_posts after it.
 * unfortunately i’m getting an undefined call to query_posts error. any idea why?
 * [http://tucker-restoration.com/](http://tucker-restoration.com/) for output

The topic ‘Call to undefined function query_posts()’ is closed to new replies.

## Tags

 * [Call to undefined function:](https://wordpress.org/support/topic-tag/call-to-undefined-function/)
 * [index.php](https://wordpress.org/support/topic-tag/index-php/)
 * [query_posts](https://wordpress.org/support/topic-tag/query_posts/)
 * [theme development](https://wordpress.org/support/topic-tag/theme-development/)

 * 0 replies
 * 1 participant
 * Last reply from: [blasher](https://wordpress.org/support/users/blasher/)
 * Last activity: [14 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-function-query_posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
