Title: Getting data from WP
Last modified: August 18, 2016

---

# Getting data from WP

 *  [jamesk5](https://wordpress.org/support/users/jamesk5/)
 * (@jamesk5)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/)
 * I’m trying to get my posts from my blog and have them published on my main home
   page.
    Basically, I only wanna show the 3 most recent posts on the home page,
   so I’m not sure how to get the data from the WP database and then display it 
   on a non-wp page.

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

 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206703)
 * If your home page is a PHP document, it’s pretty easy to accomplish:
 * [http://wordpress.org/support/topic/24027#post-180517](http://wordpress.org/support/topic/24027#post-180517)
 *  Thread Starter [jamesk5](https://wordpress.org/support/users/jamesk5/)
 * (@jamesk5)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206730)
 * Thanks, I looked at that but I’ve got 2 issues with that:
    1. I loose my current template design as soon as I put that code in, and turn WP_USE_THEMES’,
       from true to false
    2. “From there you can use all the standard WordPress functions and template tags.
       Just make sure the require has the correct path for wp-blog-header.php.” I don’t
       know what functions and tags to use?? Where can I read about these? Admin panel???
       I looked through the wp-blog-header.php and it makes a tiny bit of sense to 
       me.
 * Thanks
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206731)
 * All you have to do is add the Loop to your pre-existing webpage.
 * [http://codex.wordpress.org/The_Loop](http://codex.wordpress.org/The_Loop)
 * For more info, please do a search here for “integrate” or “the loop”.
 *  Thread Starter [jamesk5](https://wordpress.org/support/users/jamesk5/)
 * (@jamesk5)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206733)
 * Why would my template (in HTML) dissapear though?? I close off the <?php ?> tags..
   so shouldnt the HTML still display??
 *  [Kafkaesqui](https://wordpress.org/support/users/kafkaesqui/)
 * (@kafkaesqui)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206822)
 * Make sure this occurs *before* you include wp-blog-header.php:
 * `define('WP_USE_THEMES', false);`
 * If that doesn’t work, try removing the line altogether.
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206825)
 * Thanks for pointing that out, KafkaesquÃ­. I’ve updated the Codex entry.

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

The topic ‘Getting data from WP’ is closed to new replies.

## Tags

 * [external](https://wordpress.org/support/topic-tag/external/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 6 replies
 * 3 participants
 * Last reply from: [James Huff](https://wordpress.org/support/users/macmanx/)
 * Last activity: [20 years, 10 months ago](https://wordpress.org/support/topic/getting-data-from-wp/#post-206825)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
