Title: techdriver's Replies | WordPress.org

---

# techdriver

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

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

 Search replies:

## Forum Replies Created

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

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Resent posts and page display](https://wordpress.org/support/topic/resent-posts-and-page-display/)
 *  Thread Starter [techdriver](https://wordpress.org/support/users/techdriver/)
 * (@techdriver)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/resent-posts-and-page-display/#post-683482)
 * Thanks alot that worked great.
 * There is the code for displaying recent posts and displaying a specific “page”
   on a static home page
 * <?php get_header();?>
    <div id=”main”> <div id=”content”> Latest News – _[see all](https://wordpress.org/wp-edbfa/?cat=3)_
   <?php rewind_posts(); ?> <?php $recent = new WP_Query(‘cat=3&showposts=3’); while(
   $recent->have_posts() ) : $recent->the_post(); ?> <div class=”post2″ id=”post-
   <?php the_ID(); ?>”>
    -  | Posted: <?php the_time(‘F j, Y’); ?>
    - </div>
       <?php endwhile; ?>
    - <?php
       $mypage = new WP_Query(‘page_id=5’); while ( $mypage->have_posts() ):
      $mypage->the_post(); ?>
    - <div class=”page” id=”post-<?php the_ID(); ?>”>
       <h2><?php the_title(); ?>
      </h2> <div class=”entry”> <?php the_content(__(‘Continue Reading »’)); ?></
      div> </div> <?php endwhile; ?>
    -  </div>
    -  <?php get_sidebar();?>
       <?php get_footer();?>
    - thanks again
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Resent posts and page display](https://wordpress.org/support/topic/resent-posts-and-page-display/)
 *  Thread Starter [techdriver](https://wordpress.org/support/users/techdriver/)
 * (@techdriver)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/resent-posts-and-page-display/#post-683474)
 * Would this be loop problem?
 * The first loop works fine but the second loop has an error but it does show the
   page.
 * Can you run a second loop on the same page (static home.php)
    When I try I get
   an error like: _error msg:_Call to a member function on a non-object in /home.
   php line 21
 * line21( on the second loop): while ( $page->have_posts() ) : $page->the_post();
   ?
   > Is there something I need to do to support two loops on the same page.
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Resent posts and page display](https://wordpress.org/support/topic/resent-posts-and-page-display/)
 *  Thread Starter [techdriver](https://wordpress.org/support/users/techdriver/)
 * (@techdriver)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/resent-posts-and-page-display/#post-683463)
 * Well it works but I get this msg also
 * Fatal error: Call to a member function on a non-object in /home.php on line 20
 * This is what I have…I am not sure if this is the correct way to code this.
 * <?php get_header();?>
    <div id=”main”> <div id=”content”> Latest News – _[see all](https://wordpress.org/wp-edbfa/?cat=3)_
 * <?php
    $recent = new WP_Query(‘cat=3&showposts=3’); while ( $recent->have_posts()):
   $recent->the_post(); ?> <div class=”post2″ id=”post-<?php the_ID(); ?>”>
    - <?php the_title(); ?>
 * </div>
    <?php endwhile; ?>
 *  <?php
    $page = new WP_Query(‘page_id=5’); //this is the line where it said the
   error is\\ while ( $page->have_posts() ) : $page->the_post(); ?> <div class=”
   page” id=”post-<?php the_ID(); ?>”> <h2><?php the_title(); ?></h2> </div> <?php
   endwhile; ?> </div>
 *  <?php get_sidebar();?>
    <?php get_footer();?>
 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [Resent posts and page display](https://wordpress.org/support/topic/resent-posts-and-page-display/)
 *  Thread Starter [techdriver](https://wordpress.org/support/users/techdriver/)
 * (@techdriver)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/resent-posts-and-page-display/#post-683458)
 * I tryed the code above and I get this
 * Parse error: syntax error, unexpected T_WHILE in
    ???

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