Title: Problem with the loop
Last modified: August 19, 2016

---

# Problem with the loop

 *  [alexborras](https://wordpress.org/support/users/alexborras/)
 * (@alexborras)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-the-loop-1/)
 * I am using this code to see a list of post titles:
 *     ```
       query_posts("cat=7&showposts=10");
       ?>
       <ul>
       <?php while (have_posts()) : the_post(); ?>
       <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
       <?php endwhile;?>
       </ul>
       <?php
       ```
   
 * the result is correct:
    * Post 1 * Post 2 * … but after seeing the list is again
   the full content of the Post: Post 1 Text of Post 1 … Post 2 Text of Post 2 …
 * Is there a way to view only the list of the titles of the Post?

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

 *  [Mark / t31os](https://wordpress.org/support/users/t31os_/)
 * (@t31os_)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-the-loop-1/#post-1636722)
 * If you’re seeing content it’s not the result of the code you have above, there’s
   nothing in that code that would output the post content.
 *  Thread Starter [alexborras](https://wordpress.org/support/users/alexborras/)
 * (@alexborras)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-the-loop-1/#post-1636724)
 * OK, thanks

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

The topic ‘Problem with the loop’ is closed to new replies.

## Tags

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

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [alexborras](https://wordpress.org/support/users/alexborras/)
 * Last activity: [15 years, 9 months ago](https://wordpress.org/support/topic/problem-with-the-loop-1/#post-1636724)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
