Title: accessing the loop code
Last modified: August 20, 2016

---

# accessing the loop code

 *  [webguync](https://wordpress.org/support/users/webguync/)
 * (@webguync)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/accessing-the-loop-code/)
 * I am trying to access the code for the WordPress loop. I am using the twenty-
   ten theme. The code should look something like this, but I didn’t see it off 
   hand in any of the files I looked through.
 * _[please use the ‘code’ button to [mark any directly posted code](http://codex.wordpress.org/Forum_Welcome#Posting_Code)]_
 *     ```
       <ul class="posts">
       <?php query_posts('showposts=10'); ?>
       <?php while (have_posts()) : the_post(); ?>
   
       <li><a>" title="<?php the_title(); ?>"
       rel="bookmark"><?php the_title(); ?>
       </a></li>
       <?php endwhile ; ?>
       </u>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * (@adeptris)
 * [14 years, 10 months ago](https://wordpress.org/support/topic/accessing-the-loop-code/#post-2142782)
 * You need to wrap any code here in `
    The wordpress loop code is in a<a href=”
   [http://codex.wordpress.org/Function_Reference/get_template_part”&gt](http://codex.wordpress.org/Function_Reference/get_template_part”&gt);
   template part</a> called loop.php.
 * If you want to change the code and it is the index.php file, then save loop.php
   as loop-index.php make any change in this file.
 * Better still use a child theme 🙂
 * Line 56:
    `<?php while ( have_posts() ) : the_post(); ?>`
 * In the upcoming twenty eleven theme the files are no longer called `loop-index.
   php` they are called `content-index.php` etc:
 * HTH
 * David

Viewing 1 replies (of 1 total)

The topic ‘accessing the loop code’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Digital Raindrops](https://wordpress.org/support/users/adeptris/)
 * Last activity: [14 years, 10 months ago](https://wordpress.org/support/topic/accessing-the-loop-code/#post-2142782)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
