Title: Query pages within included ajax file.
Last modified: August 19, 2016

---

# Query pages within included ajax file.

 *  [Mobster](https://wordpress.org/support/users/mobster/)
 * (@mobster)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/query-pages-within-included-ajax-file/)
 * I have spent hours and absolutely cannot seem to query pages with an ajax request.
 * I am using a jquery Ajax tabs script. I uses ajax to call external pages and 
   loads them.
 * It handles php and php includes ok.
    It handles html ok. It handles
 * But when loaded into a WordPress page, it absolutely will not query any posts
   or pages. What could possibly be preventing queries from running in Ajax?
 * Is is possible to database connect, query posts into any static page or Ajax?

Viewing 1 replies (of 1 total)

 *  [dmatranga](https://wordpress.org/support/users/dmatranga/)
 * (@dmatranga)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/query-pages-within-included-ajax-file/#post-1165556)
 * did you ever figure this out?
 * I have a 2-column layout for my custom WP theme, with a list of all teh posts
   in the left column and the display of the posts in the right column. Ideally,
   I’d like to query the WP database whenever a link is clicked and then display
   that post on the right side without reloading the sidebar. Is this possible?
 * Thanks,
    Dan

Viewing 1 replies (of 1 total)

The topic ‘Query pages within included ajax file.’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [queries](https://wordpress.org/support/topic-tag/queries/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [dmatranga](https://wordpress.org/support/users/dmatranga/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/query-pages-within-included-ajax-file/#post-1165556)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
