Title: mini-loop on static html
Last modified: August 19, 2016

---

# mini-loop on static html

 *  Resolved [noname1](https://wordpress.org/support/users/greyisgood/)
 * (@greyisgood)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/mini-loop-on-static-html/)
 * I am trying to add the 10 most recent posts from my blog to the homepage of my
   website (a static html).
 * When I follow these [instructions](http://codex.wordpress.org/Creating_a_Static_Front_Page)
   this is the output I get:
 * # get_results(“SELECT ID,post_title FROM $wpdb->posts WHERE post_status= \”publish\”
   ORDER BY ‘ID’ DESC LIMIT “.$how_many); foreach($news as $np){ print (“ID); print(“\”
   >$np->post_title
    “); } ?>
 * I’ve tried various tweaks, all fail… Can anyone help me out, so I can update 
   the codex page (tagged as needed edit)… quite a few having this same problem

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

 *  Thread Starter [noname1](https://wordpress.org/support/users/greyisgood/)
 * (@greyisgood)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/mini-loop-on-static-html/#post-811623)
 * really stuck with this one…
 *  [tsguitar](https://wordpress.org/support/users/tsguitar/)
 * (@tsguitar)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/mini-loop-on-static-html/#post-811658)
 * You can’t do it with an HTML page. It needs to be a page that can take PHP (so
   use .phtml, .phtm, or .php). I’m not sure why that page in the codex lists [all those pages](http://codex.wordpress.org/Creating_a_Static_Front_Page#Create_and_Upload_a_Static_Front_Page)
   that aren’t capable of running PHP. The reason your page is simply rendering 
   the PHP as text is because the server doesn’t think a page with an HTML extension
   should run PHP scripts. Change it to .phtml and you should see a difference.
 *  Thread Starter [noname1](https://wordpress.org/support/users/greyisgood/)
 * (@greyisgood)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/mini-loop-on-static-html/#post-811660)
 * that works!
 * Thanks for your help on that one… there are some wrongers in the codex 😉

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

The topic ‘mini-loop on static html’ is closed to new replies.

## Tags

 * [epic fail](https://wordpress.org/support/topic-tag/epic-fail/)
 * [fail](https://wordpress.org/support/topic-tag/fail/)
 * [html](https://wordpress.org/support/topic-tag/html/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [noname1](https://wordpress.org/support/users/greyisgood/)
 * Last activity: [17 years, 11 months ago](https://wordpress.org/support/topic/mini-loop-on-static-html/#post-811660)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
