Title: castus's Replies | WordPress.org

---

# castus

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

 *   [Profile](https://wordpress.org/support/users/castus/)
 *   [Topics Started](https://wordpress.org/support/users/castus/topics/)
 *   [Replies Created](https://wordpress.org/support/users/castus/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/castus/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/castus/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/castus/engagements/)
 *   [Favorites](https://wordpress.org/support/users/castus/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: [.htaccess issue](https://wordpress.org/support/topic/htaccess-issue-1/)
 *  [castus](https://wordpress.org/support/users/castus/)
 * (@castus)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/htaccess-issue-1/#post-649417)
 * Your server isn’t a windows server is it?
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Title and date only to use outside wordpress](https://wordpress.org/support/topic/title-and-date-only-to-use-outside-wordpress/)
 *  Thread Starter [castus](https://wordpress.org/support/users/castus/)
 * (@castus)
 * [18 years, 6 months ago](https://wordpress.org/support/topic/title-and-date-only-to-use-outside-wordpress/#post-649372)
 * Whenever I try to set up the code as shown, the PHP fails and nothing is outputted.
 * I tried putting in echo ‘test’; throughout the code to see where it stops. It
   stopped right after require(‘/news/wp-blog-header.php’);. I changed this to include
   rather than require and the php got to the next line, but failed again at get_header();
 * I have made a fresh php file and only have the code on the create a static page
   in the php file. But it doesn’t seem to be working.
 * My wp install is in /news/ and here is my code so far (all i want it a list of
   posts)
 * > <?php
   >  define(‘WP_USE_THEMES’, false); include(‘/news/wp-blog-header.php’);//
   > get_header(); ?> <div id=”content” class=”narrowcolumn”> <?php # Here starts
   > Mini Loop trick: You can use this code, but _at your own risk_ # If you want
   > to improve this code, you’re welcome 😉 $how_many=7; //How many posts do you
   > want to show ?> <ul class=”whats-new”> <? $news=$wpdb->get_results(“SELECT 
   > ID,post_title FROM $wpdb->posts WHERE ‘post_type’=\”post\” AND ‘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); } ?>
   > </div>

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