Title: post loop repeats
Last modified: November 17, 2019

---

# post loop repeats

 *  [omarsvu](https://wordpress.org/support/users/omarsvu/)
 * (@omarsvu)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/post-loop-repeats/)
 * I have two post loop , they are repeating twice in the page while i caled them
   just once???
 *     ```
       	<div class="announc">
             <h2> إعلانات </h2>
       	<div class="announc-body">
       	<ul>
       	<?php
       		query_posts('cat=6');
       		if (have_posts() ){
       			while (have_posts()){
       			the_post();?>
       	<li> <a href=" <?php the_permalink() ?>" title="<?php the_title() ;
   
       			?>">
       			<?php echo mb_strimwidth(get_the_title(), 0, 30, '...'); 
   
       			?></a> </li>
       			<?php 
       			}
       		}
       		wp_reset_query();
   
       		?>
       	</ul>
       	</div>
       	</div>
       ```
   
 * and
 *     ```
       	<div class="announc">
             <h2> مؤتمرات </h2>
       	<div class="announc-body">
       	<ul>
       	<?php
       		query_posts('cat=5');
       		if (have_posts() ){
       			while (have_posts()){
       			the_post();?>
       	<li> <a href=" <?php the_permalink() ?>" title="<?php the_title() ;
   
       			?>">
       			<?php echo mb_strimwidth(get_the_title(), 0, 30, '...'); 
   
       			?></a> </li>
       			<?php 
       			}
       		}
       		wp_reset_query();
   
       		?>
       	</ul>
       	</div>
       	</div>
       ```
   
    -  This topic was modified 6 years, 6 months ago by [Jan Dembowski](https://wordpress.org/support/users/jdembowski/).
      Reason: Moved to Developing with WordPress, this is not a Developing with 
      WordPress topic

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

 *  Moderator [Jan Dembowski](https://wordpress.org/support/users/jdembowski/)
 * (@jdembowski)
 * Forum Moderator and Brute Squad
 * [6 years, 6 months ago](https://wordpress.org/support/topic/post-loop-repeats/#post-12142523)
 * [@omarsvu](https://wordpress.org/support/users/omarsvu/) Don’t create duplicate
   topics. I have archived your newer topic and moved this one to the correct sub-
   forum.
 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/post-loop-repeats/#post-12143410)
 * There is no problem with the code you posted, the extra pass is the result of
   something external to the posted code.

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

The topic ‘post loop repeats’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 3 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [6 years, 6 months ago](https://wordpress.org/support/topic/post-loop-repeats/#post-12143410)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
