Title: jasontwright's Replies | WordPress.org

---

# jasontwright

  [  ](https://wordpress.org/support/users/jasontwright/)

 *   [Profile](https://wordpress.org/support/users/jasontwright/)
 *   [Topics Started](https://wordpress.org/support/users/jasontwright/topics/)
 *   [Replies Created](https://wordpress.org/support/users/jasontwright/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/jasontwright/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/jasontwright/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/jasontwright/engagements/)
 *   [Favorites](https://wordpress.org/support/users/jasontwright/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Most Recent Post Titles on Static Page](https://wordpress.org/support/topic/most-recent-post-titles-on-static-page/)
 *  Thread Starter [jasontwright](https://wordpress.org/support/users/jasontwright/)
 * (@jasontwright)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/most-recent-post-titles-on-static-page/#post-2931584)
 * Looks like the following code works:
 *     ```
       <?php
       $how_many=5; //How many posts do you want to show
       require_once("./news/wp-config.php"); // Change this for your path to wp-config.php file?>
       <ul>
       <?
       $news=$wpdb->get_results("SELECT 'ID', 'post_title', 'post_date' FROM $wpdb->posts
       WHERE 'post_status'= \"publish\" ORDER BY ID DESC LIMIT $how_many");
       foreach($news as $np){
       printf ("
       <li><a href="/news/index.php?p=%s">%s</a></li>
       ", $np->ID,$np->post_title);
       }?>
       ```
   
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Most Recent Post Titles on Static Page](https://wordpress.org/support/topic/most-recent-post-titles-on-static-page/)
 *  Thread Starter [jasontwright](https://wordpress.org/support/users/jasontwright/)
 * (@jasontwright)
 * [13 years, 9 months ago](https://wordpress.org/support/topic/most-recent-post-titles-on-static-page/#post-2931487)
 * Thanks for the quick response! However, I have tried both ASC and DESC to no 
   avail.

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