Title: Loop isn&#039;t working
Last modified: August 20, 2016

---

# Loop isn't working

 *  [chopsky](https://wordpress.org/support/users/chopsky/)
 * (@chopsky)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/loop-isnt-working-1/)
 * Anyone have any idea why this loop isn’t working? Nothing displays and I already
   have several posts:
 *     ```
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       <?php the_content(); wp_link_pages(); ?>
       <?php endwhile; endif; ?>
       ```
   
 * Thanks!

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

 *  [Kaung Ko](https://wordpress.org/support/users/kaugko/)
 * (@kaugko)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/loop-isnt-working-1/#post-3548624)
 * which php file do you placed the code?
 *  Thread Starter [chopsky](https://wordpress.org/support/users/chopsky/)
 * (@chopsky)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/loop-isnt-working-1/#post-3548632)
 * it’s in page.php
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/loop-isnt-working-1/#post-3548641)
 * you might need to add a query before the code;
 * if this is your secondary loop in page.php then probably better use `WP_Query()`–
   [http://wordpress.stackexchange.com/questions/1753/when-should-you-use-wp-query-vs-query-posts-vs-get-posts?rq=1](http://wordpress.stackexchange.com/questions/1753/when-should-you-use-wp-query-vs-query-posts-vs-get-posts?rq=1)
 * what is the full code of page.php right now?
    and what exactly are you trying
   to achieve?
 *  Thread Starter [chopsky](https://wordpress.org/support/users/chopsky/)
 * (@chopsky)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/loop-isnt-working-1/#post-3548643)
 * I have created a “Blog” page which I have set to be a static page for the Front
   page to display. I have set the Blog page to the Default Template, which I believe
   is page.php. I simply want my site’s home page to be the blog.
 * The code is as below:
 *     ```
       <?php get_header(); ?>
   
       <?php if (function_exists('dynamic_sidebar') && is_page() && is_active_sidebar('page-sidebar')): ?>
       <div class="siteColumnLeft clearfix">
       <?php endif; ?>
   
       <div class="separator"></div>
   
       <!-- Content -->
       <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       <?php the_content(); wp_link_pages(); ?>
       <?php endwhile; endif; ?>
   
       <?php if (function_exists('dynamic_sidebar') && is_page() && is_active_sidebar('page-sidebar')): ?>
       </div>
       <?php endif; ?>
   
       <?php get_sidebar(); ?>
       <?php get_footer(); ?>
       ```
   
 * _[[No bumping](http://codex.wordpress.org/Forum_Welcome#No_Bumping). If it’s 
   that urgent, consider [hiring someone](http://jobs.wordpress.net/).]_

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

The topic ‘Loop isn't working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 3 participants
 * Last reply from: [chopsky](https://wordpress.org/support/users/chopsky/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/loop-isnt-working-1/#post-3548643)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
