Title: Static Splash Page: Loop Coding Problems
Last modified: August 18, 2016

---

# Static Splash Page: Loop Coding Problems

 *  [idlan](https://wordpress.org/support/users/idlan/)
 * (@idlan)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/static-splash-page-loop-coding-problems/)
 * The setup is as follows:
 * I have a static intro page, where I would like to show the latest entries from
   two WP powered blogs currently on my server. I have used the code from [http://codex.wordpress.org/Creating_a_Static_Front_Page](http://codex.wordpress.org/Creating_a_Static_Front_Page).
   Because I need to call from two different wp-config.php files, I modified the
   require_once() command to include(path/to/wp-config.php). This is shown in the
   code below. However what has happened is that I get the latest entry from only
   one blog – you can see this here: [http://www.idlanzakaria.com/home.php](http://www.idlanzakaria.com/home.php)
 * I am very sure the correction is very minor, but I am a total PHP novice, and
   am totally stuck. I’d be grateful for any and all pointers.
 * Here is the code I used:
 * <?php
    $how_many=5; //How many posts do you want to show include(“/home/idlanzak/
   public_html/conversed/wp-config.php”); // Change this for your path to wp-config.
   php file ?> <ol id=”whats-new”>
 * <?
    $news=$wpdb->get_results(“SELECT `ID`,`post_title` FROM $wpdb->posts WHERE`
   post_status`= \”publish\” ORDER BY ‘ID’ DESC LIMIT “.$how_many); foreach($news
   as $np){ printf (”
    - 
    - “, $np->ID,$np->post_title);
       }?>
    - <?php
       $how_many=5; //How many posts do you want to show include(“/home/idlanzak/
      public_html/wordpress/wp-config.php”); // Change this for your path to wp-
      config.php file ?> <ol id=”whats-new”> <? $news=$wpdb->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 (”
    - <a href=\””);
       echo get_permalink($np->ID); print (“\”>$np->post_title
    - “);
       } ?>

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

 *  [forumozel](https://wordpress.org/support/users/forumozel/)
 * (@forumozel)
 * [20 years, 3 months ago](https://wordpress.org/support/topic/static-splash-page-loop-coding-problems/#post-341887)
 * [http://www.forumozel..tr.cx](http://www.forumozel..tr.cx)
 *  [roccanet](https://wordpress.org/support/users/roccanet/)
 * (@roccanet)
 * [19 years, 7 months ago](https://wordpress.org/support/topic/static-splash-page-loop-coding-problems/#post-342196)
 * I have created a [tutorial to get post excerpts published to any web page with a built in cache ](http://www.roccanet.com/blog/tutorial/tutorial-integrating-wordpress-2-blog-to-an-existing-site-with-cache/)–
   i also had a very hard time getting the loop to do what i wanted and did not 
   like that every time i got a post hit my DB would get a call…hope this might 
   help`

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

The topic ‘Static Splash Page: Loop Coding Problems’ is closed to new replies.

## Tags

 * [front](https://wordpress.org/support/topic-tag/front/)
 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 2 replies
 * 3 participants
 * Last reply from: [roccanet](https://wordpress.org/support/users/roccanet/)
 * Last activity: [19 years, 7 months ago](https://wordpress.org/support/topic/static-splash-page-loop-coding-problems/#post-342196)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
